Limit user files in media library

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

Count and message according to number of user files

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

change media owner

// 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

parallax

.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

Remove Gutenberg Blocks Library CSS

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

ModalCSS

!function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){“undefined”!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:”Module”}),Object.defineProperty(e,”__esModule”,{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&”object”==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,”default”,{enumerable:!0,value:e}),2&t&&”string”!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,”a”,t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=””,o(o.s=1)}([function(e,t,o){“use strict”;function n(){return(n=Object.assign||function(e){for(var t=1;tContinue reading

ModalJS

!function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){“undefined”!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:”Module”}),Object.defineProperty(e,”__esModule”,{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&”object”==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,”default”,{enumerable:!0,value:e}),2&t&&”string”!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,”a”,t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=””,o(o.s=1)}([function(e,t,o){“use strict”;function n(){return(n=Object.assign||function(e){for(var t=1;tContinue reading