Limit Media Library to Given Folder

A solution that works for me is to add a clause to the WordPress query when the media library is being displayed. From browsing my WordPress database I noticed that the full path to wp_posts.post_type=”attachment” is stored in the wp_posts.guid column. add_filter(‘posts_where’, ‘limitMediaLibraryItems_56456’, 10, 2 ); function limitMediaLibraryItems_56456($where, &$wp_query) { global $pagenow, $wpdb; // Do … Read more

Multiple WordPress sites with docker

Following Docker’s philosophy of “one application per container” you should have a database container for each WordPress instance. This way each database is isolated from the others. Should anything happen to one database it will not affect the others. Also, if you want to migrate or take down one website you only need to act … Read more

How to Add Customizer Setting in Child Theme

OK, check out the theme developer handbook. $wp_customize->add_control( ‘reblog_number_control’, array( ‘label’ => __( ‘Number of Reblogs’, ‘tesseract-child’ ), ‘section’ => ‘tesseract_footer_options’, ‘settings’ => ‘number_of_reblogs’, ‘type’ => ‘text’, ‘priority’ => 10 ) ); Since you are in the child theme ‘title’ => __( ‘Reblog Options’, ‘tesseract’ ), shoudl be ‘title’ => __( ‘Reblog Options’, ‘tesseract-child’ ), … Read more

Why do folders have Empty Index.php Pages?

As a security measure, WordPress includes these index.php files to account for hosts that by default enable directory browsing. Including them makes sure that no one can see the list of files in that directory, which could let them know what plugins or versions you are running and thus give them some things to try … Read more

Modify column_author in WP_Comments_List_Table

This is how the email part is displayed by the WP_Comments_List::column_author() method: /* This filter is documented in wp-includes/comment-template.php */ $email = apply_filters( ‘comment_email’, $comment->comment_author_email, $comment ); if ( ! empty( $email ) && ‘@’ !== $email ) { printf( ‘<a href=”https://wordpress.stackexchange.com/questions/258903/%1$s”>%2$s</a><br />’, esc_url( ‘mailto:’ . $email ), esc_html( $email ) ); } so you’re … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)