true ) ); $options = get_option( 'addtoany_options', array() ); $title = apply_filters( 'A2A_SHARE_SAVE_meta_box_title', __( 'AddToAny', 'add-to-any' ) ); foreach( $post_types as $post_type ) { if ( // If automatic placement is enabled // for either floating bar isset( $options['floating_vertical'] ) && 'none' != $options['floating_vertical'] || isset( $options['floating_horizontal'] ) && 'none' != $options['floating_horizontal'] || // for standard buttons in posts 'post' == $post_type && ( ! isset( $options['display_in_posts'] ) || $options['display_in_posts'] != '-1' ) || // for standard buttons in pages 'page' == $post_type && ( ! isset( $options['display_in_pages'] ) || $options['display_in_pages'] != '-1' ) || // for standard buttons in a custom post type ! isset( $options['display_in_cpt_' . $post_type] ) || $options['display_in_cpt_' . $post_type] != '-1' ) { // Add meta box add_meta_box( 'A2A_SHARE_SAVE_meta', $title, 'A2A_SHARE_SAVE_meta_box_content', $post_type, 'advanced', 'high' ); } } } function A2A_SHARE_SAVE_meta_box_content( $post ) { do_action( 'start_A2A_SHARE_SAVE_meta_box_content', $post ); $disabled = get_post_meta( $post->ID, 'sharing_disabled', true ); ?>

AddToAny Sharing Settings'; $pointer_content .= '

To customize your AddToAny share buttons, click "AddToAny" in the Settings menu.

'; ?> true, '_builtin' => false ), 'objects' ) ); foreach ( $custom_post_types as $custom_post_type_obj ) { $placement_name = $custom_post_type_obj->name; $new_options['display_in_cpt_' . $placement_name] = ( isset( $_POST['A2A_SHARE_SAVE_display_in_cpt_' . $placement_name] ) && $_POST['A2A_SHARE_SAVE_display_in_cpt_' . $placement_name] == '1' ) ? '1' : '-1'; } // Schedule cache refresh? if ( isset( $_POST['A2A_SHARE_SAVE_cache'] ) && $_POST['A2A_SHARE_SAVE_cache'] == '1' ) { A2A_SHARE_SAVE_schedule_cache(); A2A_SHARE_SAVE_refresh_cache(); } else { A2A_SHARE_SAVE_unschedule_cache(); } // Store desired text for text-only: $new_options['button_text'] = ( trim( $_POST['A2A_SHARE_SAVE_button_text'] ) != '' ) ? $_POST['A2A_SHARE_SAVE_button_text'] : __('Share','add-to-any'); // Store chosen individual services to make active $active_services = array(); if ( ! isset( $_POST['A2A_SHARE_SAVE_active_services'] ) ) $_POST['A2A_SHARE_SAVE_active_services'] = array(); foreach ( $_POST['A2A_SHARE_SAVE_active_services'] as $dummy=>$sitename ) { $service = substr( $sitename, 7 ); $active_services[] = $service; // AddToAny counter enabled? if ( in_array( $service, array( 'facebook', 'pinterest', 'linkedin', 'reddit' ) ) ) { $new_options['special_' . $service . '_options'] = array( 'show_count' => ( ( isset( $_POST['addtoany_' . $service . '_show_count'] ) && $_POST['addtoany_' . $service . '_show_count'] == '1') ? '1' : '-1' ) ); } } $new_options['active_services'] = $active_services; // Store special service options $new_options['special_facebook_like_options'] = array( 'verb' => ( ( isset( $_POST['addtoany_facebook_like_verb'] ) && $_POST['addtoany_facebook_like_verb'] == 'recommend') ? 'recommend' : 'like' ) ); $new_options['special_twitter_tweet_options'] = array( 'show_count' => '-1' // Twitter doesn't provide counts anymore ); $new_options['special_google_plusone_options'] = array( 'show_count' => ( ( isset( $_POST['addtoany_google_plusone_show_count'] ) && $_POST['addtoany_google_plusone_show_count'] == '1' ) ? '1' : '-1' ) ); $new_options['special_google_plus_share_options'] = array( 'show_count' => ( ( isset( $_POST['addtoany_google_plus_share_show_count'] ) && $_POST['addtoany_google_plus_share_show_count'] == '1' ) ? '1' : '-1' ) ); $new_options['special_pinterest_pin_options'] = array( 'show_count' => ( ( isset( $_POST['addtoany_pinterest_pin_show_count'] ) && $_POST['addtoany_pinterest_pin_show_count'] == '1' ) ? '1' : '-1' ) ); } // Get all existing AddToAny options $existing_options = get_option( 'addtoany_options', array() ); // Merge $new_options into $existing_options to retain AddToAny options from all other screens/tabs if ( $existing_options ) { $new_options = array_merge( $existing_options, $new_options ); } update_option( 'addtoany_options', $new_options ); ?>

array( 'selected' => ( 'bottom' == $options['position'] ) ? ' selected="selected"' : '', 'string' => __( 'bottom', 'add-to-any' ) ), 'top' => array( 'selected' => ( 'top' == $options['position'] ) ? ' selected="selected"' : '', 'string' => __( 'top', 'add-to-any' ) ), 'both' => array( 'selected' => ( 'both' == $options['position'] ) ? ' selected="selected"' : '', 'string' => __( 'top & bottom', 'add-to-any' ) ) ); if ( $option_box ) { $html = ''; $html .= '