plugin development: problem with functions

The main problem is you are using static callbacks while you should be passing on the object so you have access to your class properties. You can fire off the initialization like this: class Myclass { public function __construct() { // Object method call, instead of a static one add_action(‘init’, array($this, ‘init’)); } public function … Read more

Any Short code Availble for Get Post List With Thumbnail Plugin?

here is a quick crack at making it a shortcode paste this code in your theme’s functions.php file: add_shortcode(‘gplt’,’getPostListThumbs_shortcode’); function getPostListThumbs_shortcode($atts, $content = null){ extract(shortcode_atts(array( ‘orient’ => ‘v’, ‘imgo’ => false, ‘ttgo’ => false, ‘dtgo’ => false, ‘dtfrm’ => 1, ‘categ’ => ”, ‘postnr’ => 20, ‘linn’ => 3, ‘tbwid’ => 40, ‘tbhig’ => 40 … Read more

WordPress plugin for activating other plugins

You’re main pluggin can use register_activation_hook and use the function you register thru the hook to activate you’re necesary pluggins. Smth along these lines : // get already activated plugins $plugins = get_option(‘active_plugins’); $puginsToActiv = array(‘Plugin1’, ‘Plugin2’, ‘Plugin3’); if($plugins) { $changed = false; foreach ($puginsTostActiv as $plugin) { if (!in_array($plugin, $plugins)) { $changed = true; … Read more

Change the ‘published on’ text?

Use a gettext filter and match against the text. add_filter( ‘gettext’, ‘filter_published_on’, 10000, 2 ); function filter_published_on( $trans, $text ) { if( ‘Published on: <b>%1$s</b>’ == $text ) { global $post; switch( $post->post_type ) { case ‘your-posttype’: return ‘Whatever on: <strong>%1$s</strong>’; break; default: return $trans; break; } } return $trans; } The alternative would be … Read more

Upload to a remote server using wp_remote_post

Something like this, perhaps. $args[‘body’] = array(‘post_file’=>’@/path/FILE.EXT’); wp_remote_post($url, $args); The $args array contains the parameters for the post. The body parameter controls what is posted. There’s many other possible parameters as well. See http://codex.wordpress.org/HTTP_API#Other_Arguments Note that the @file method may be specific to curl, and might not work with the other possible HTTP transports that … Read more