options = $this->sanitizeOptions(get_option('wp5jsgal_options')); add_action('admin_init', array($that,'register_settings')); add_action('admin_menu', array($that,'admin_add_page')); add_shortcode('jsg500px', array($that,'getShortcode')); add_filter('plugin_action_links_'.plugin_basename(___FILE___),array($that,'add_settings_link')); add_filter('plugin_row_meta',array($that,'add_plugin_desc_links'),10,2); load_plugin_textdomain('wp-500px-jsgallery',false,basename(dirname(___FILE___)).'/lang/'); $this->scripts_loaded=false; } public function activate() { //From v2.0 on plugin activation, we need to check if it's a new install or an upgrade //On updrage we force the use of CSS v1 to not be disruptive for the gallery layout $db_ver_opt=intval(get_option('wp5jsgal_option_db_ver')); if($db_ver_optoptions[self::_force_css_v1]=1; update_option('wp5jsgal_options',$this->options); } } } //Settings page public function register_settings(){ global $that; register_setting('wp5jsgal_options','wp5jsgal_options',array($that,'options_validate')); add_settings_section('wp5jsgal_main', esc_html__('Main Settings','wp-500px-jsgallery'), array($that,'main_section_text'), 'wp5jsgal_settings_page'); add_settings_field('wp5jsgal_user',esc_html__('500px User','wp-500px-jsgallery'),null,'wp5jsgal_settings_page','default'); } public function admin_add_page(){ global $that; add_options_page(esc_html__('WP 500px jsGallery Settings','wp-500px-jsgallery'),esc_html__('WP 500px jsGallery','wp-500px-jsgallery'), 'manage_options', 'wp5jsgal_settings_page', array($that,'output_settings_page')); } public function main_section_text() { $output='

'; $output.=''.esc_html__('How to use this plugin:','wp-500px-jsgallery').'
'; $output.=esc_html__('1. Set the 500px username and save the changes.','wp-500px-jsgallery').'
'; $output.=esc_html__('2. Use the [jsg500px] shortcode in the page you want to show the 500px gallery on.','wp-500px-jsgallery').'
'; $output.=esc_html__('3. (Optional) Use the "user500px" shortcode param to set a different username for a single page.','wp-500px-jsgallery').'
'; $output.='

'; echo $output; } public function output_settings_page(){ ?>

   v



(