// Create the settings page function restrict_user_posts_settings_page() { add_options_page( ‘Restrict User Posts Settings’, ‘Restrict User Posts’, ‘manage_options’, ‘restrict-user-posts-settings’, ‘restrict_user_posts_settings_page_content’ ); } add_action(‘admin_menu’, ‘restrict_user_posts_settings_page’); // Display the settings page content function restrict_user_posts_settings_page_content() { ?>Continue reading
function limit_media_files($file) { // Get the current user ID $current_user_id = get_current_user_id(); // Query media files for the current user $media_files = new WP_Query(array( ‘post_type’ => ‘attachment’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => -1, ‘author’ => $current_user_id )); // Check if…Continue reading
function count_user_media_files() { // Check if the current page is the media library $screen = get_current_screen(); if ($screen->id !== ‘upload’) { return; } // Get the current user ID $current_user_id = get_current_user_id(); // Query media files for the current user…Continue reading
// Add a custom column in the Media Library list view function custom_media_columns($columns) { // Check if the current user is an administrator if (current_user_can(‘manage_options’)) { $columns[‘change_author’] = ‘Author’; } return $columns; } add_filter(‘manage_media_columns’, ‘custom_media_columns’); // Display the ‘Change Author’…Continue reading
add_filter( ‘wpcode_snippet_output_html’, ‘do_shortcode’ );Continue reading
.parallax { background-image: url(“http://example.com/wp-content/uploads/2017/08/my-background-image.jpg”); height: 100%; background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover; margin-left:-410px; margin-right:-410px; } .parallax-content { width:50%; margin:0 auto; color:#FFF; padding-top:50px; }Continue reading
function adms_remove_wp_block_library_css(){ wp_dequeue_style( ‘wp-block-library’ ); wp_dequeue_style( ‘wp-block-library-theme’ ); wp_dequeue_style( ‘wc-blocks-style’ ); // Remove WooCommerce block CSS } add_action( ‘wp_print_styles’, ‘adms_remove_wp_block_library_css’, 100 );Continue reading