"Widget showing available jobs from aditrorecruit." ) // Args ); } public function form( $instance ) { if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; } else { $title = "Lediga jobb"; } if ( isset( $instance[ 'show_work' ] ) ) { $show_work = $instance[ 'show_work' ]; } else { $show_work = ""; } ?>
Other settings can be found under Aditroreqruit Settings."; } public function update( $new_instance, $old_instance ) { $instance['show_work'] = strip_tags( $new_instance['show_work'] ); $instance['title'] = $new_instance['title']; return $instance; } public function widget( $args, $instance ) { extract( $args ); $render = hk_aditro_render(true); $retValue = ""; if ($instance["show_work"] == "" || in_array(get_query_var("cat"), split(",",$instance["show_work"]))) { if (!empty($render)) { $retValue .= $before_widget; $title = apply_filters( 'widget_title', $instance['title'] ); if ( ! empty( $title ) ) { $retValue .= $before_title . $title . $after_title; } $retValue .= $render; $retValue .= $after_widget; } } echo $retValue; } } /* add the widget */ add_action( 'widgets_init', create_function( '', 'register_widget( "hk_aditro_rss_widget" );' ) ); /* * add settings page */ // create custom plugin settings menu add_action('admin_menu', 'hk_aditro_plugin_create_menu'); function hk_aditro_plugin_create_menu() { //create new top-level menu add_menu_page('Aditroreqruit Plugin Settings', 'Aditroreqruit', 'administrator', __FILE__, 'hk_aditro_plugin_settings_page' , NULL /*plugins_url('/images/icon.png', __FILE__)*/ ); //call register settings function add_action( 'admin_init', 'register_hk_aditro_plugin_settings' ); } function register_hk_aditro_plugin_settings() { //register our settings register_setting( 'hk_aditro_settings', 'hk_aditro' ); } function hk_aditro_plugin_settings_page() { ?>