' . __( 'Review', 'custom-post-widget' ) . ' | ' . __( 'Donate', 'custom-post-widget' ) . ' ';
}
return $links;
}
}
add_filter( 'plugin_row_meta', 'cpw_plugin_links', 10, 2 );
require_once( 'meta-box.php' );
require_once( 'popup.php' );
// Enqueue styles and scripts on content_block edit page
function cpw_enqueue() {
$screen = get_current_screen();
// Check screen base and current post type
if ( 'post' === $screen -> base && 'content_block' === $screen -> post_type ) {
wp_enqueue_style( 'cpw-style', plugins_url( '/assets/css/custom-post-widget.css', __FILE__ ) );
wp_enqueue_script( 'clipboard', plugins_url( '/assets/js/clipboard.min.js', __FILE__ ), array(), '2.0.6', true );
wp_enqueue_script( 'clipboard-init', plugins_url( '/assets/js/clipboard.js', __FILE__ ), array(), false, true );
}
}
add_action( 'admin_enqueue_scripts', 'cpw_enqueue' );
// Only add content_block icon above posts and pages
function cpw_add_content_block_button() {
global $current_screen;
if ( ( 'content_block' != $current_screen -> post_type ) && ( 'toplevel_page_revslider' != $current_screen -> id ) ) {
add_action( 'media_buttons', 'add_content_block_icon' );
add_action( 'admin_footer', 'add_content_block_popup' );
}
}
add_action( 'admin_head', 'cpw_add_content_block_button' );
}