"1", "wpar_chk_rating_box_hide" => "", "wpar_chk_rating_after_post_display" => "1", "wpar_box_width" => "300", "wpar_drp_box_align" => "right", "wpar_drp_button_color" => "orange", "wpar_chk_default_options_db" => "" ); update_option('wpar_options', $arr); } } // ------------------------------------------------------------------------------ // CALLBACK FUNCTION FOR: add_action('admin_init', 'wpar_init' ) // ------------------------------------------------------------------------------ // THIS FUNCTION RUNS WHEN THE 'admin_init' HOOK FIRES, AND REGISTERS YOUR PLUGIN // SETTING WITH THE WORDPRESS SETTINGS API. YOU WON'T BE ABLE TO USE THE SETTINGS // API UNTIL YOU DO. // ------------------------------------------------------------------------------ // Init plugin options to white list our options function wpar_init(){ register_setting( 'wpar_plugin_options', 'wpar_options', 'wpar_validate_options' ); } // ------------------------------------------------------------------------------ // CALLBACK FUNCTION FOR: add_action('admin_menu', 'wpar_add_options_page'); // ------------------------------------------------------------------------------ // THIS FUNCTION RUNS WHEN THE 'admin_menu' HOOK FIRES, AND ADDS A NEW OPTIONS // PAGE FOR YOUR PLUGIN TO THE SETTINGS MENU. // ------------------------------------------------------------------------------ // Add menu page function wpar_add_options_page() { // add main menu add_menu_page( __( 'Author hReview' ), __( 'Author hReview' ), 'administrator', 'authorhreview', 'wpar_render_form', plugin_dir_url( 'author-hreview/images/stars_admin.png' , __FILE__ ).'stars_admin.png', 49 ); // set second menu item title add_submenu_page('authorhreview','Settings','Settings','manage_options','authorhreview','wpar_render_form'); } // screen icon function, can be called by wpar_screen_icon(); function wpar_screen_icon () { echo '
'; } // ------------------------------------------------------------------------------ // CALLBACK FUNCTION SPECIFIED IN: add_options_page() // ------------------------------------------------------------------------------ // THIS FUNCTION IS SPECIFIED IN add_options_page() AS THE CALLBACK FUNCTION THAT // ACTUALLY RENDER THE PLUGIN OPTIONS FORM AS A SUB-MENU UNDER THE EXISTING // SETTINGS ADMIN MENU. // ------------------------------------------------------------------------------ // Render the Plugin options form function wpar_render_form() { echo '
'; wpar_screen_icon(); echo '

Author hReview Settings Ver '. WPAR_VER.'

'; echo '

Get more control over Google SERP.

'; echo '

We have a new awesome plugin called WPRichSnippets, which can be used to create amazing reviews sites. Enjoy high class support, more control over your reviews, half rating, templates, shortcodes, widgets, and more!

Click here for more info

'; echo '
'; settings_fields('wpar_plugin_options'); $options = get_option('wpar_options'); echo '
'; require_once ('settings_social.php'); // load scial settings require_once ('settings_general.php'); // load general settings echo '
'; echo '
'; echo '
'; echo '
'; echo ''; } // Sanitize and validate input. Accepts an array, return a sanitized array. function wpar_validate_options($input) { // strip html from textboxes $input['wpar_box_width'] = wp_filter_nohtml_kses($input['wpar_box_width']); // Sanitize textarea input (strip html tags, and escape characters) //$input['txt_one'] = wp_filter_nohtml_kses($input['txt_one']); // Sanitize textbox input (strip html tags, and escape characters) return $input; } // Display a Settings link on the main Plugins page function wpar_plugin_action_links( $links, $file ) { if ( $file == plugin_basename( __FILE__ ) ) { $posk_links = ''.__('Settings').''; // make the 'Settings' link appear first array_unshift( $links, $posk_links ); } return $links; } // Extra links for the plugin page function wpar_admin_links() { ?>