Send email on Job Dispatched from WP e-commerce [closed]

I’d suggest you start by looking at action ‘wpsc_purchase_log_update’, which is triggered in wpsc-includes/purchase-log.class.php and passes the wpsc_purchase_log object. Test the $previous_status member of that object, and the new status value (might be in data member as $data[‘statusno’]) == WPSC_Purchase_Log::JOB_DISPATCHED. Something like this (untested): add_action(‘wpsc_purchase_log_update’, ‘wpse_73707_wpscPurchaseLogUpdate’); /** * trigger event or option to the “Job … Read more

PHP WordPress optimization my loop code

Hi there is not better option, but to speed it up little you can use wordpress transient, see documentation: http://codex.wordpress.org/Transients_API your code would look like this (and i cleaned it bit and used function empty to check array…): <?php if ( false === ( $tag_descrip = get_transient( ‘tag_descrip’ ) ) ) { $tag_descrip = get_terms( … Read more

How to display posts by current user in a drop down

Use ‘author’ => get_current_user_id() as an argument for get_posts(). This will restrict the found posts to these of the user which is currently logged in. The best reference for the available parameters is still WP_Query::parse_query() in wp-includes/query.php. It is not exactly an atomic function, but you can find parameters not documented elsewhere – like this … Read more

How to Sort posts by Vote Count?

Simply wrap the hooks in a conditional check something like: if (is_home() || is_front_page()){ add_filter(‘posts_orderby’, ‘edit_posts_orderby’); add_filter(‘posts_join_paged’,’edit_posts_join_paged’); } and leave the rest as is.

WordPress Theme Options Values

Your input and textarea have the same name and id, so when the data is processed, it’s only going to recognise one (probably the last). Try using different name and id properties, and you should be able to differentiate between the 2.

Dynamic Sidebars & Echo

You don’t need to echo dynamic_sidebar(). End your echo, call dynamic_sidebar(), and then start a new echo. To make it easier, just close/reopen your PHP tags: <?php if( fake if code ) { if( another fake if code ) { ?> <div class=”sidebar sidebar-first”> <ul class=”widget-area first”> <?php dynamic_sidebar( ‘pop-news-sidebar’ ); ?> </ul> </div> <?php … Read more

Trying to get property of non-object “ wordpress ”

It looks like the $args passed to the function is not an object for some reason. I can’t see the origin of this problem but for a quick solution, you can add $args = (object) $args; before the first time you use $args, here on line 44 Also, as commented by toscho, dropdown_menu() is not … Read more

Pull the content out of a page

While inside a query loop, this function will output the current posts title: the_title(); This function will output the content: the_content(); What I suspect has happened however is that you are instead calling get_template_part( ‘content’, ‘page’ ); and expecting it to output the content for the page, when what it’s actually doing is checking if … Read more

How can I Add a variable PHP in the Menu Nav

You should never need a plugin to insert raw PHP code somewhere. There are always side effects you cannot see or fix easily. Filter wp_nav_menu_objects instead, and add the parameter here to the URLs. if ( ! empty ( $_GET[‘partenaire’] ) ) add_filter( ‘wp_nav_menu_objects’, ‘wpse_82194_add_param’ ); /** * Add a parameter to item URLs. * … Read more