WordPress.org

Ready to get started?Download WordPress

Forums

WP Native Dashboard
[resolved] default options (6 posts)

  1. radky
    Member
    Posted 2 years ago #

    Hello
    wonder can it be done plugin,
    I use it as a WPMU, have included default options

    http://wordpress.org/extend/plugins/wp-native-dashboard/

  2. codestyling
    Member
    Plugin Author

    Posted 1 year ago #

    I can't understand the issue, please describe it more in detail.

  3. Christian Foellmann
    Member
    Posted 1 year ago #

    I think I understand:

    You want to set/change the default settings after this comment //options defaults in the wp-native-dashboard.php for new created sites. These settings would be accessible via the network administration

    +1 on that. Could be implemented with my feature request: http://wordpress.org/support/topic/multisite-features-2?replies=1

  4. codestyling
    Member
    Plugin Author

    Posted 1 year ago #

    No extension required, use build in filters within your own multisite must use plugin for this purpose:

    apply_filters( 'default_option_' . $option, $default );

    in this case it will look like:

    function my_defaults($default) {
       //patch here the StdClass members
       return $default;
    }
    add_filter( 'default_option_wp-native-dashboard', 'my_defaults' );

    will only be called, if the option was not at the database.

  5. Christian Foellmann
    Member
    Posted 1 year ago #

    I have a network-wide activated custom plugin for my "hacks" but can not get your tip to work:

    function wp_nd_defaults($default) {
    
        $default = array(   "version"                        => '1.0',
                            "installed"                      => false,
                            "enable_login_selector"          => true,
                            "enable_login_custom"            => true,
                            "enable_profile_extension"       => true,
                            "enable_language_switcher"       => false,
                            "enable_adminbar_switcher"       => false,
                            "enable_locale_abbreviations"    => false,
                            "translate_front_adminbar"       => true,
                            "cleanup_on_deactivate"          => false
        );
    
       return $default;
    }
    add_filter( 'default_option_wp-native-dashboard', 'wp_nd_defaults' );

    ???

    When added the activation of WP Native Dashboard goes horribly wrong.

  6. jazbek
    Member
    Posted 1 year ago #

    I think you need to return $default as an object, not an array.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.