WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Jun 28 2012

Get All Images Taken with a Specific Camera: How to Query Attachments' Meta Data in WordPress

Recently, I became curious about wp_generate_attachment_metadata() & wp_update_attachment_metadata() which should be used in conjunction with wp_insert_attachment().

wp_generate_attachment_metadata() generates the following array:

The most curious about this was image_meta which is generated by wp_read_image_metadata().

So I then wondered if one could query the posts and pull all posts that have a specific camera or specific shutter speed. The answer is YES!

Written by Travis Smith · Categorized: WordPress

Jun 25 2012

[Infographic] HackerTarget WordPress Usage

HackerTarget WordPress Usage
HackerTarget WordPress Usage Click for Larger Image

Written by Travis Smith · Categorized: Infographic, WordPress

Jun 18 2012

[Infographic] TechKing Power of WordPress

TechKing Power of WordPress
TechKing Power of WordPress Click for Larger Image

Written by Travis Smith · Categorized: Infographic, WordPress

Jun 11 2012

Limit Admin Page Editing Capabilities to Page Owners by Capability

Currently, WordPress does a great job displaying pages on the Edit Pages admin area for users with the capability edit_others_pages. However, if a user has edit_others_pages and has not yet authored any pages, WordPress defaults to listing all the pages removing edit actions, etc. Recently I had the need to list NO PAGES/POSTS except what the person has authored.

[php]<?php
add_action( 'pre_get_posts', 'wps_admin_exclude_pages' );
/*
* Modifies the admin query for a specific author for the Edit Posts
* and Pages admin pages checking capability.
*
* @param WP_Query Object $query Original Query Object
* @return WP_Query Object $query Original/Modified Query Object
*/
function wps_admin_exclude_pages( $query ) {
if( ! is_admin() )
return $query;

global $pagenow, $user_ID;
if( 'edit.php' == $pagenow && 'page' == get_query_var( 'post_type' ) && ! current_user_can( 'edit_others_pages' ) )
$query->set( 'author', $user_ID );

if( 'edit.php' == $pagenow && 'post' == get_query_var( 'post_type' ) && ! current_user_can( 'edit_others_posts' ) )
$query->set( 'author', $user_ID );

return $query;
}
[/php]

Written by Travis Smith · Categorized: WordPress

Jun 11 2012

[Infographic] HubSpot 12 Homepage Elements

HubSpot 12 Homepage Elements
HubSpot 12 Homepage Elements Click for Larger Image

Written by Travis Smith · Categorized: Infographic, WordPress

  • « Previous Page
  • 1
  • …
  • 16
  • 17
  • 18
  • 19
  • 20
  • …
  • 60
  • Next Page »

Need Help?

Please let us know how we can help you!

Get Help

Recommendations

Genesis WordPress Framework
Sucuri Security
Gravity Forms
GetSoliloquy
Get Envira
Scribe SEO
BackupBuddy
WordPress Video User Manuals

Recent Posts

  • Solving WordPress 5XX Server Errors on SiteGround
  • Hiding an User in the WordPress Admin
  • Custom Rewrite Rules for Custom Post Types and Taxonomies
  • WordPress JavaScript Manager Native Functions
  • Causes of WordPress Site Performance Slowdown

About Travis

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in