true ) ) : array( 'post', 'page' ) ; $title = apply_filters( 'A2A_SHARE_SAVE_meta_box_title', __( 'AddToAny', 'add-to-any' ) ); foreach( $post_types as $post_type ) { 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 ); ?>
'1', // Modernly used for "Use CSS Stylesheet?" 'cache' => '-1', 'display_in_posts_on_front_page' => '1', 'display_in_posts_on_archive_pages' => '1', 'display_in_posts' => '1', 'display_in_pages' => '1', 'display_in_feed' => '1', 'show_title' => '-1', 'onclick' => '-1', 'button' => 'A2A_SVG_32', 'button_custom' => '', 'additional_js_variables' => '', 'button_text' => 'Share', 'display_in_excerpts' => '1', 'active_services' => Array(), ); $namespace = 'A2A_SHARE_SAVE_'; foreach ($options as $option_name => $option_value) { $old_option_name = $namespace . $option_name; $old_option_value = get_option($old_option_name); if($old_option_value === FALSE) { // Default value $options[$option_name] = $option_value; } else { // Old value $options[$option_name] = $old_option_value; } delete_option($old_option_name); } update_option('addtoany_options', $options); $deprecated_options = array( 'button_opens_new_window', 'hide_embeds', ); foreach ($deprecated_options as $option_name) { delete_option($namespace . $option_name); } } function A2A_SHARE_SAVE_options_page() { global $A2A_SHARE_SAVE_plugin_url_path, $A2A_SHARE_SAVE_services; // Require admin privs if ( ! current_user_can('manage_options') ) return false; $new_options = array(); $namespace = 'A2A_SHARE_SAVE_'; // Make available services extensible via plugins, themes (functions.php), etc. $A2A_SHARE_SAVE_services = apply_filters('A2A_SHARE_SAVE_services', $A2A_SHARE_SAVE_services); if (isset($_POST['Submit'])) { // Nonce verification check_admin_referer('add-to-any-update-options'); $new_options['position'] = ($_POST['A2A_SHARE_SAVE_position']) ? @$_POST['A2A_SHARE_SAVE_position'] : 'bottom'; $new_options['display_in_posts_on_front_page'] = (@$_POST['A2A_SHARE_SAVE_display_in_posts_on_front_page']=='1') ? '1':'-1'; $new_options['display_in_posts_on_archive_pages'] = (@$_POST['A2A_SHARE_SAVE_display_in_posts_on_archive_pages']=='1') ? '1':'-1'; $new_options['display_in_excerpts'] = (@$_POST['A2A_SHARE_SAVE_display_in_excerpts']=='1') ? '1':'-1'; $new_options['display_in_posts'] = (@$_POST['A2A_SHARE_SAVE_display_in_posts']=='1') ? '1':'-1'; $new_options['display_in_pages'] = (@$_POST['A2A_SHARE_SAVE_display_in_pages']=='1') ? '1':'-1'; $new_options['display_in_feed'] = (@$_POST['A2A_SHARE_SAVE_display_in_feed']=='1') ? '1':'-1'; $new_options['show_title'] = (@$_POST['A2A_SHARE_SAVE_show_title']=='1') ? '1':'-1'; $new_options['onclick'] = (@$_POST['A2A_SHARE_SAVE_onclick']=='1') ? '1':'-1'; $new_options['icon_size'] = @$_POST['A2A_SHARE_SAVE_icon_size']; $new_options['button'] = @$_POST['A2A_SHARE_SAVE_button']; $new_options['button_custom'] = @$_POST['A2A_SHARE_SAVE_button_custom']; $new_options['additional_js_variables'] = trim(@$_POST['A2A_SHARE_SAVE_additional_js_variables']); $new_options['inline_css'] = (@$_POST['A2A_SHARE_SAVE_inline_css']=='1') ? '1':'-1'; $new_options['cache'] = (@$_POST['A2A_SHARE_SAVE_cache']=='1') ? '1':'-1'; // Schedule cache refresh? if (@$_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 if 16 x 16px buttons or text-only is chosen: if( $new_options['button'] == 'favicon.png|16|16' ) $new_options['button_text'] = $_POST['A2A_SHARE_SAVE_button_favicon_16_16_text']; elseif( $new_options['button'] == 'share_16_16.png|16|16' ) $new_options['button_text'] = $_POST['A2A_SHARE_SAVE_button_share_16_16_text']; else $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 ) $active_services[] = substr($sitename, 7); $new_options['active_services'] = $active_services; // Store special service options $new_options['special_facebook_like_options'] = array( 'verb' => ((@$_POST['addtoany_facebook_like_verb'] == 'recommend') ? 'recommend' : 'like') ); $new_options['special_twitter_tweet_options'] = array( 'show_count' => ((@$_POST['addtoany_twitter_tweet_show_count'] == '1') ? '1' : '-1') ); $new_options['special_google_plusone_options'] = array( 'show_count' => ((@$_POST['addtoany_google_plusone_show_count'] == '1') ? '1' : '-1') ); $new_options['special_google_plus_share_options'] = array( 'show_count' => ((@$_POST['addtoany_google_plus_share_show_count'] == '1') ? '1' : '-1') ); $new_options['special_pinterest_pin_options'] = array( 'show_count' => ((@$_POST['addtoany_pinterest_pin_show_count'] == '1') ? '1' : '-1') ); update_option('addtoany_options', $new_options); ?>