Discourse::get_plugin_options PHP Method

get_plugin_options() static public method

static public get_plugin_options ( )
    static function get_plugin_options()
    {
        return wp_parse_args(get_option('discourse'), Discourse::$options);
    }

Usage Example

Example #1
0
 function publish_to_discourse()
 {
     global $post;
     $options = Discourse::get_plugin_options();
     if (in_array($post->post_type, $options['allowed_post_types'])) {
         if ($post->post_status == 'auto-draft') {
             $value = $options['auto-publish'];
         } else {
             $value = get_post_meta($post->ID, 'publish_to_discourse', true);
         }
         echo '<div class="misc-pub-section misc-pub-section-last">
        <span>' . '<input type="hidden" name="showed_publish_option" value="1">' . '<label><input type="checkbox"' . ($value == "1" ? ' checked="checked" ' : null) . 'value="1" name="publish_to_discourse" /> Publish to Discourse</label>' . '</span></div>';
     }
 }
All Usage Examples Of Discourse::get_plugin_options