Making WordPress.org


Ignore:
Timestamp:
09/11/2016 07:53:40 PM (10 years ago)
Author:
ocean90
Message:

Rosetta: Filter the default options for Jetpack's sharing module.

See #2003.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site/class-locale-main.php

    r4031 r4032  
    22namespace WordPressdotorg\Rosetta\Site;
    33
     4use WordPressdotorg\Rosetta\Filter;
    45use WordPressdotorg\Rosetta\Jetpack;
    56use WordPressdotorg\Rosetta\User;
    … …  
    5657                ] );
    5758                $jetpack_module_manager->setup();
     59
     60                $options = new Filter\Options();
     61                // Options for Jetpack's sharing module.
     62                $options->add_option(
     63                        ( new Filter\Option() )
     64                                ->set_name( 'sharing-options' )
     65                                ->set_callback( function() {
     66                                        return [
     67                                                'global' => [
     68                                                        'button_style'  => 'icon-text',
     69                                                        'sharing_label' => __( 'Share this:', 'rosetta' ),
     70                                                        'open_links'    => 'same',
     71                                                        'show'          => [ 'post' ],
     72                                                        'custom'        => [],
     73                                                ],
     74                                        ];
     75                                } )
     76                );
     77                $options->add_option(
     78                        ( new Filter\Option() )
     79                                ->set_name( 'sharing-services' )
     80                                ->set_callback( function() {
     81                                        return [
     82                                                'visible' => [ 'facebook', 'twitter', 'google-plus-1', 'email' ],
     83                                                'hidden'  => [],
     84                                        ];
     85                                } )
     86                );
     87                $options->setup();
    5888        }
    5989}
Note: See TracChangeset for help on using the changeset viewer.