How to get post ID with hooks publish_post, new_to_publish, etc

I have two plugins, one uses the function wp_insert_post(), the other has a code like this: add_action(‘future_to_publish’, ‘myFunc’, 10, 1); add_action(‘new_to_publish’, ‘myFunc’, 10, 1); add_action(‘draft_to_publish’, ‘myFunc’, 10, 1); function myFunc( $postID ) { } When the first plugin runs wp_insert_post(), $postID is always empty. If I use the hook « publish_post » and press update then $postID does have a value, so what I am doing wrong? Source:

Web Design Weekly #40

Headlines Adobe & HTML Adobe & HTML is a single place where the Adobe team can share everything they are working on. You can find up-to-date information about all of their different HTML projects, discover which events they will be attending and find out how you can join them in making the web better. ( Modern Web Development Part 1 – The Webkit Inspector A super awesome post by Majd Taby about the Webkit Inspector. The blog post is the first in a series of posts that attempts to outline…

Display a custom taxonomy as a dropdown on the edit posts page

When you create a custom taxonomy, seemingly the only options are to display it as a tag (non-hierarchical) or category (hierarchical). Is there a way to display them as a dropdown menu? I realise that this an be done using add_meta_box() and actually manually adding it, but I’m looking for a builtin way (if one exists), to save lots of code! Thanks. Source:

remove custom taxonomy base / slug [duplicate]

Possible Duplicate: Remove slug in taxonomy url I’m using proreview theme and it uses a custom taxonomy called « review-cats » In of this I want I’ve been trying to find a solution for 2 days not … relevant code register_taxonomy( « review-cats », array(« reviews »), array( « hierarchical » => false, « label » => « Categories », « singular_label » => « Category », « rewrite » => true ) ); Source:

Web Design Weekly #39

Headlines A Baseline for Front-End Developers Once upon a time, editing files, testing them locally (as best as we could, anyway), and then FTPing them to the server was the essential workflow of a front-end dev. ‘Times are a changin’. Rebecca Murphey gives a comprehensive overview of the new set of baseline skills required in order to be successful as a front-end developer. ( Responsive Viewport Units With all this new fangled talk of responsive web design, it’s about time that we had a poster child CSS unit to go…

Filter posts under multiple categories?

How do I filter the posts by multiple categories? For example, if some of my posts are categorized under just apples and some as just oranges and some both, how would I filter the results to show only posts marked under both apples and oranges? In other words, I don’t want the results to list all posts under apples and all posts under oranges. I only want to show posts listed under both apples and oranges. Is there a way to do this? Source:

Create a custom admin page for custom post type + taxonomies + metas

I’m writing a plugin that realies on custom post types, new taxonomy and few custom fields. All this data will be private (not queryable or searchable). I’d like to provide an admin page to the user, to add and edit this data in a more suer-friendly way. For instance, the custom post type will have only a title and the excerpt field, one taxonomy and the custom fields. I know how to add meta boxes to a custom post type, but this is not enough to me. I’d like to…

Web Design Weekly #38

Headlines Design Is A Job – New book from A Book Apart ( Screen Resolution Alert for Web Developers ( Articles CSS Sprites Revisited Niels Matthijs looks into the wonderful world of CSS sprites. He touches on various techniques but the standout for me is the LESS and SASS tips. ( 10 things every designer needs to know about forms There are a lot of badly designed forms out there, but whether you like them or not, forms are essential. Joe Leech, user experience director at cxpartners, presents the lessons…

Loop to fetch 3 post_thumbnail instances from 3 most recent custom post types named "portfolio"

I am trying to display 3 post_thumbnails from a custom post type « portfolio » on my homepage template. So one from post ‘A’ , one from post ‘B’ and one from post ‘C’ The image from post A will be set as post_thumbnail(‘large’) while B & C need to be set to post_thumbnail(‘thumbnail’). I’ve set a custom WP_Query loop and as expected it is looping through and fetching three instances of the post thumbnail for each of the most recent three « portfolio » posts. I’m just not sure how to modify the…