>
>
>
>

>

>
>
>
true, '_builtin' => false ); $post_types = get_post_types($args); foreach ($post_types as $post_type ) { $post_type = get_post_type_object($post_type); ?> name, false ) == true) echo ' checked'; ?>>

None as the +1 Button position or would like to add additional +1 Buttons to your theme, please use the <?php do_action( \'wp_plus_one_button\', $url, $style, $css); ?> hook in your plugin or theme.'); ?>

$url (optional) is the URL to +1 (will be the_permalink() if blank), $style (optional) is the button style (standard, small, medium, tall), and $css (optional) is any extra CSS to add to the button DIV.'); ?>

true, '_builtin' => false ); $post_types = get_post_types($args); foreach ($post_types as $post_type ) { update_option( 'wp-plus-one-show-on-' . $post_type, $_POST['wp-plus-one-show-on-' . $post_type] == 'true' ); } add_action('admin_notices', 'wp_plus_one_save_message'); } wp_enqueue_script( 'wp-plus-one', 'http://apis.google.com/js/plusone.js', null, '1.0.0', true ); } function wp_plus_one_save_message() { echo '
' . __('Google +1 Button Settings Saved') . '
'; } function wp_plus_one_button( $url='', $size='', $css='' ) { if ( !$url ) $url = get_permalink(); if ( !$url ) return; if ( $css ) $tag = '
#wp_plus_one_option_form h2 { clear: both; } #wp_plus_one_option_form .wp_plus_one_button { margin: 8px; } '; } add_action('admin_head', 'wp_plus_one_admin_css'); add_filter('the_content', 'wp_plus_one'); add_action('admin_menu', 'wp_plus_one_menu'); add_action('init', 'wp_plus_one_init'); function wp_plus_one_add_meta_box() { if ( get_option( 'wp-plus-one-show-on-post', true ) ) add_meta_box( 'wp_plus_one_meta', __('Google +1 Settings'), 'wp_plus_one_meta_box_content', 'post', 'advanced', 'high' ); if ( get_option( 'wp-plus-one-show-on-page', false ) ) add_meta_box( 'wp_plus_one_meta', __('Google +1 Settings'), 'wp_plus_one_meta_box_content', 'page', 'advanced', 'high' ); // add metabox to custom post types $args = array( 'public' => true, '_builtin' => false ); $post_types = get_post_types($args); foreach ($post_types as $post_type ) { if ( get_option( 'wp-plus-one-show-on-' . $post_type, false ) ) add_meta_box( 'wp_plus_one_meta', __('Google +1 Settings'), 'wp_plus_one_meta_box_content', $post_type, 'advanced', 'high' ); } } function wp_plus_one_meta_box_content( $post ) { $wp_plus_one_checked = get_post_meta( $post->ID, 'wp_plus_one_disabled', false ); if ( empty( $wp_plus_one_checked ) || $wp_plus_one_checked === false ) $wp_plus_one_checked = ' checked="checked"'; else $wp_plus_one_checked = ''; echo '

'; } function wp_plus_one_meta_box_save( $post_id ) { if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id; // Record wp_plus_one disable if ( 'post' == $_POST['post_type'] || 'page' == $_POST['post_type'] ) { if ( current_user_can( 'edit_post', $post_id ) ) { if ( isset( $_POST['wp_plus_one_status_hidden'] ) ) { if ( !isset( $_POST['enable_post_wp_plus_one'] ) ) update_post_meta( $post_id, 'wp_plus_one_disabled', 1 ); else delete_post_meta( $post_id, 'wp_plus_one_disabled' ); } } } return $post_id; } function wp_plus_one_plugin_settings( $links ) { $settings_link = ''.__('Settings').''; array_unshift( $links, $settings_link ); return $links; } function wp_plus_one_add_plugin_settings($links, $file) { if ( $file == basename( dirname( __FILE__ ) ).'/'.basename( __FILE__ ) ) { $links[] = '' . __('Settings') . ''; $links[] = '' . __('Support') . ''; } return $links; } add_action( 'admin_init', 'wp_plus_one_add_meta_box' ); add_action( 'save_post', 'wp_plus_one_meta_box_save' ); add_action( 'plugin_action_links_'.basename( dirname( __FILE__ ) ).'/'.basename( __FILE__ ), 'wp_plus_one_plugin_settings', 10, 4 ); add_filter( 'plugin_row_meta', 'wp_plus_one_add_plugin_settings', 10, 2 );