WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

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

Jun 04 2012

[Infographic] Quickly Code WordPress Help Sheet

Quickly Code WordPress Help Sheet
Quickly Code WordPress Help Sheet Click for Larger Image

Written by Travis Smith · Categorized: Infographic, WordPress

  • « Previous Page
  • 1
  • …
  • 9
  • 10
  • 11
  • 12
  • 13
  • …
  • 25
  • Next Page »
  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

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