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 ); ?>