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 remove row-actions from pages table?

For non-hierarchical post types the filter is called post_row_actions, for hierarchical it’s page_row_actions. If you want to remove all actions you don’t have to unset the individual items, you can just return an empty array. add_filter( ‘page_row_actions’, ‘wpse16327_page_row_actions’, 10, 2 ); function wpse16327_page_row_actions( $actions, $post ) { if ( ‘page’ == $post->post_type ) { return … Read more

Add custom objects/entities to WordPress

I think what you want is to create what WorpPress calls “Custom Post Types”. Please have a look at the Post Type page in the Codex that explains what Post Types are and how to create custom ones. Basically, here is the code to create the Object custom post type : add_action( ‘init’, ‘create_post_type’ ); … Read more

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