Tag Info

Hot answers tagged

3

<?php class someClass { public function __construct($options = null, $initialize = true, $error_messages = null, $path, $qnty) { //construct what you see fit here.... } //etc.. } // Action listener add_action( 'action_name', create_function('', "new someClass(implode(',',func_get_args()));"), 10, 5 // IMPORTANT, ...


3

The standard query for posts uses orderby => 'post_date' and order => 'DESC'. The best candidate for arbitrary sort of posts would be orderby => 'menu_order' and order => 'ASC'. The menu_order is not generally used for posts but it is safe to be used. As suggested by Pieter Goosen use action hook pre_get_posts: add_action( 'pre_get_posts', ...


2

Add this to your wp-config.php: const JETPACK_DEV_DEBUG = TRUE; This makes it possible to use features on localhost that don’t require a connection to wordpress.com. See the announcement post on jetpack.me for the background. For your own plugins, learn that lesson: Do not rely on working outgoing connections. Respect your users privacy, and explain in ...


1

This is just, how I understood the idea of the WordPress File API. If it is wrong, please downvote :) Okay. If you upload a file, this file has an owner. If you upload your file with FTP, you login and the file will be owned by the FTP user. Since you have the credentials, you can alter these files through FTP. The owner can usually execute, delete, alter ...


1

There are two issues with what your form is currently trying to do: action="page-rebrander.php" is meaningless to WP (if you actually do have such custom file — you shouldn't). In WP mechanics you should be typically submitting form to the page itself, options.php (for Settings API), or admin-post.php (for more generic forms). You are trying to pass data ...


1

The reason is that you can register native PHP functions as callbacks. Passing more parameters to them then they expect will raise a warning. Imagine a filter that can pass 6 parameters and trim() as callback. PHP would now raise an error: Warning: Wrong parameter count for trim() in … Some custom callbacks might also change their behavior depending ...


1

I searched everywhere in post type registration flow but didn't found a right way (using filter or action) to do it. All you can do either register the post type again with a different slug (I prefer) or just run those lines of code which WordPress run to build the rewrite rules in register_post_type. I register this post type with slug book and changed it ...



Only top voted, non community-wiki answers of a minimum length are eligible