Settings'; array_unshift($links, $settings_link); return $links; } /* function run_on_activate() { add_action( 'admin_notices', array($this, 'display_message') ); // add_action('admin_head', array($this,'custom_print_footer_scripts') ); } function display_message(){ $screen = get_current_screen(); if($screen->id == "plugins") { $plugin = site_url().'/wp-admin/admin.php?page=rich_snippet_dashboard'; echo '

'.__( "All in One Schema.org Rich Snippets is installed ! New features are added. Click Here to configure.", "rich-snippets" ).'

'; } }*/ //print the star rating style on post edit page function post_enqueue($hook) { if( 'post.php' != $hook ) return; // wp_enqueue_script( 'bsf_jquery' ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'bsf_jquery_star' ); wp_enqueue_script( 'bsf_toggle' ); wp_enqueue_style( 'star_style' ); } function post_new_enqueue($hook) { if('post-new.php' != $hook ) return; // wp_enqueue_script( 'bsf_jquery' ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'bsf_jquery_star' ); wp_enqueue_script( 'bsf_toggle' ); wp_enqueue_style( 'star_style' ); } //Initialize the metabox class function wp_initialize_bsf_meta_boxes() { if ( ! class_exists( 'bsf_Meta_Box' ) ) require_once(plugin_dir_path( __FILE__ ) . 'init.php'); } function set_styles() { wp_register_style( 'star_style', plugins_url('/css/jquery.rating.css', __FILE__) ); wp_register_style( 'meta_style', plugins_url('admin/css/style.css', __FILE__) ); wp_register_script( 'bsf_jquery_ui', plugins_url('/js/jquery-ui.js', __FILE__) ); wp_register_script( 'bsf_jquery_star', plugins_url('/js/jquery.rating.min.js', __FILE__) ); wp_register_script( 'bsf_toggle', plugins_url('/js/toggle.js', __FILE__) ); } // Define icon styles for the custom post type function star_icons() { ?> '. ''. ( $req ? '*' : '' ). '

'; $fields[ 'email' ] = '

'. ''. ( $req ? '*' : '' ). '

'; return $fields; } function additional_fields () { global $post; $id = $post->ID; $type = get_post_meta($id, '_bsf_post_type', true); if($type == '7') { echo '
'; for( $i=1; $i <= 5; $i++ ) echo ''; echo'

'; echo '

'. ''. '

'; echo '

'; } } function save_comment_meta_data( $comment_id ) { if ( ( isset( $_POST['title'] ) ) && ( $_POST['title'] != '') ) $title = wp_filter_nohtml_kses($_POST['title']); add_comment_meta( $comment_id, 'title', $title ); if ( ( isset( $_POST['rating'] ) ) && ( $_POST['rating'] != '') ) $rating = wp_filter_nohtml_kses($_POST['rating']); add_comment_meta( $comment_id, 'rating', $rating ); } function extend_comment_edit_metafields( $comment_id ) { if( ! isset( $_POST['extend_comment_update'] ) || ! wp_verify_nonce( $_POST['extend_comment_update'], 'extend_comment_update' ) ) return; if ( ( isset( $_POST['title'] ) ) && ( $_POST['title'] != '') ): $title = wp_filter_nohtml_kses($_POST['title']); update_comment_meta( $comment_id, 'title', $title ); else : delete_comment_meta( $comment_id, 'title'); endif; if ( ( isset( $_POST['rating'] ) ) && ( $_POST['rating'] != '') ): $rating = wp_filter_nohtml_kses($_POST['rating']); update_comment_meta( $comment_id, 'rating', $rating ); else : delete_comment_meta( $comment_id, 'rating'); endif; } function modify_comment( $text ){ $plugin_url_path = WP_PLUGIN_URL; if( $commenttitle = get_comment_meta( get_comment_ID(), 'title', true ) ) { $commenttitle = '' . esc_attr( $commenttitle ) . '
'; $text = $commenttitle . $text; } if( $commentrating = get_comment_meta( get_comment_ID(), 'rating', true ) ) { $commentrating = '


Rating: '. $commentrating .' / 5

'; $text = $text . $commentrating; return $text; } else { return $text; } } } } require_once('functions.php'); add_filter( 'bsf_meta_boxes', 'bsf_metaboxes' ); // Instantiating the Class if (class_exists("RichSnippets")) { $RichSnippets= new RichSnippets(); } ?>