array( 'text' => __( 'Example Top Text', 'atc-menu' ), 'check' => __( '1', 'atc-menu' ), 'bc' => __( '#fff', 'atc-menu' ), 'tc' => __( '#333', 'atc-menu' ), 'upi' => __( 'http://www.example.com/picture.jpg', 'atc-menu' ) ), 'bottom' => array( 'text' => __( 'Example Bottom Text', 'atc-menu' ), 'check' => __( '1', 'atc-menu' ), 'bc' => __( '#fff', 'atc-menu' ), 'tc' => __( '#333', 'atc-menu' ), 'upi' => __( 'http://www.example.com/picture.jpg', 'atc-menu' ) ) ); add_option( 'atc_settings', apply_filters( 'atc_defaults', $defaults ) ); } // Hook for adding admin menus if ( is_admin() ){ // admin actions // Hook for adding admin menu add_action( 'admin_menu', 'atc_op_page' ); add_action( 'admin_init', 'atc_register_setting' ); // Hook to fire farbtastic includes for using built in WordPress color picker functionality add_action('admin_enqueue_scripts', 'atc_farbtastic_script'); // Display the 'Settings' link in the plugin row on the installed plugins list page add_filter( 'plugin_action_links_'.plugin_basename(__FILE__), 'atc_admin_plugin_actions', -10); } else { // non-admin enqueues, actions, and filters } // Include WordPress color picker functionality function atc_farbtastic_script() { // load the style and script for farbtastic wp_enqueue_style( 'farbtastic' ); wp_enqueue_script( 'farbtastic' ); wp_enqueue_media(); } // action function for above hook function atc_op_page() { // Add a new submenu under Settings: add_options_page(__('Add To Content','atc-menu'), __('Add To Content','atc-menu'), 'manage_options', __FILE__, 'atc_settings_page'); } function atc_register_setting() { register_setting( 'atc_options', 'atc_settings' ); } // atc_settings_page() displays the page content function atc_settings_page() { //must check that the user has the required capability if (!current_user_can('manage_options')) { wp_die( __('You do not have sufficient permissions to access this page.') ); } // variables for the field and option names $hidden_field_name = 'atc_submit_hidden'; // read options values $options = get_option( 'atc_settings' ); if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) { // Save the posted value in the database update_option( 'atc_settings', $options ); ?>

'; // icon for settings echo '
'; // header echo "

" . __( 'Add To Content Settings', 'atc-menu' ) . "

"; // settings form and farbtastic script on click shoot out ?>
Documentation - Finding out your Category ID number (Category #)
/> />
/>
/>
PLEASE DONATE <3 HAVE A HEART :)
'.__('Settings').'', ''.__('Support').'', ); return array_merge( $atc_plugin_links, $links ); } function add_to_content001($content) { $options = get_option( 'atc_settings' ); if( ( 1 == ($options['option']['one']) ) && ( 1 == ($options['top']['check']) ) && is_single() ){ $content = '
'.$options['top']['text'].'
' . $content; } if( ( 1 == ($options['option']['one']) ) && ( 1 == ($options['bottom']['check']) ) && is_single() ){ $content = $content . '
'.$options['bottom']['text'].'
'; } return $content; } add_filter('the_content', 'add_to_content001'); function add_to_content002($content) { $options = get_option( 'atc_settings' ); if( ( 1 == ($options['option']['two']) ) && ( 1 == ($options['top']['check']) ) && is_page() ){ $content = '
'.$options['top']['text'].'
' . $content; } if( ( 1 == ($options['option']['two']) ) && ( 1 == ($options['bottom']['check']) ) && is_page() ){ $content = $content . '
'.$options['bottom']['text'].'
'; } return $content; } add_filter('the_content', 'add_to_content002'); function add_to_content003($content) { $options = get_option( 'atc_settings' ); $multiCategories= $options['option']['three']; // move into usable array $multiCategoriesArray=explode(',',$multiCategories); if( in_category( $multiCategoriesArray ) && ( 1 == ($options['top']['check']) ) && is_single() && ( $options['option']['three'] != '')){ $content = '
'.$options['top']['text'].'
' . $content; } if( in_category( $multiCategoriesArray ) && ( 1 == ($options['bottom']['check']) ) && is_single() && ( $options['option']['three'] != '')){ $content = $content . '
'.$options['bottom']['text'].'
'; } return $content; } add_filter('the_content', 'add_to_content003'); function add_to_content004($content) { $options = get_option( 'atc_settings' ); if (!empty ($options['option']['four'] )) $multiCategoriesx= $options['option']['four']; // move into usable array $multiCategoriesArrayx=explode(',',$multiCategoriesx); if( ! in_category( $multiCategoriesArrayx ) && ( 1 == ($options['top']['check']) ) && is_single() && ( $options['option']['four'] != '')){ $content = '
'.$options['top']['text'].'
' . $content; } if( ! in_category( $multiCategoriesArrayx ) && ( 1 == ($options['bottom']['check']) ) && is_single() && ( $options['option']['four'] != '') ){ $content = $content . '
'.$options['bottom']['text'].'
'; } return $content; } add_filter('the_content', 'add_to_content004');