Articles of filters

Modify message displayed on post save

After a post is updated there is a message displayed, how can I change the displayed text? I would like to remove the “view post” link and change the ‘Post published’ text. I’d like to do this for a particular post type. Here is the html WordPress outputs: <div id=”message” class=”updated below-h2″><p>Post published. <a href=”http://localhost/wp/wp30/feeds/449/”>View […]

Trimming a custom field to a length

I have a custom field added through the Advanced Custom Fields Plugin. I am trying to trim the content of the field down to a set number of words. I have tried to use the excerpt filter and setting a custom length see code bellow but It’s not working, thought? // set the length of […]

Insert a div before the wp_nav_menu

How do I go about inserting a custom div before the wp_nav_menu() adds the ul? The problem is that the script is inserting my ‘div menu button’ after the nav ul instead of before it. I am trying to do this via a function because the basic idea is that on some of my menus […]

Query posts using custom taxonomy and selected terms

I’m not able to use array for the terms in the following query, only a single term: $args=array( ‘facts’ => ‘information’, //taxonomy:facts and term:information ‘post_type’ => ‘book’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘caller_get_posts’=> 1 ); $my_query = null; $my_query = new WP_Query($args) Is this normal behiavour? Is there any equivalent method for selecting posts […]

Filter WooCommerce Orders

I am using woocommerce for a “multi-seller” system. Meaning one site (no multi-site), but many sellers with different products. To let each owner only manage it’s own orders, it would like to filter all orders before they are shown in the admin area. The criteria for filtering could be a tag or the creator of […]

Change Mail from and display name with a filter action

I’m attempting to override the from display name and email address using wp_mail function. I am using the hook to modify wp_mail_from with my custom function using add_filter(‘wp_mail_from’,’abcisupport_wp_mail_from’). If I hard code the value it’ll return the address so it’s wired up properly. If I use the argument, it returns the site network defaults. How […]

how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?

How add_action(“manage_posts_custom_column”, “custom_callback_fun01”); relate to add_filter(“manage_{xxxx-xxx}_columns”, “cusotm_callback_fun02” );? How do they both work together? By using these both we add custom columns to custom posts types and show date, for example featured images in featured columns. Here is my code example, it works great but I’m a little confused on how the filter works with […]

Content filter won't work

I’m trying to filter my content and on matches on flow I would like to change my html structure, but my rule doesn’t really apply. I have the following filter which searches the first image of posts and on rule match attaching a css container. The preg_match_all is working but the str_replace doesn’t function imageFooter($content){ […]

get_the_excerpt() with fallback like the_excerpt()

You know when using the_excerpt() and no “excerpt” is set on a post it automatically uses the first 50 words or so. Is the same also possible when using get_the_excerpt() For instance I’m using get_the_excerpt() like this … $return .= sprintf(‘ <li> <div class=”title”><a href=”%1$s”>%2$s</a><span class=”goto”>a</span></div> <div class=”project-description”>%3$s</div> </li>’, get_permalink( get_the_ID() ), get_the_title(), get_the_excerpt() ); […]

wordpress remove views from action links in a custom post

I have created a custom post type, but I want to remove the View link from actions, in the listing of the custom post. I have tried this snippet add_filter( ‘post_row_actions’,array(&$this, ‘remove_row_actions’, 10, 1)); public function remove_row_actions($action){ unset($action[‘view’]); return $action; } But it throws call_user_func_array() expects parameter 1 to be a valid callback, array must […]