get author of published post
use add_action(‘publish_post’, ‘rhb_check_current_user’); and in your rhb_check_current_user function check using the global $post: function rhb_check_current_user(){ global $post; $author_id = $post->post_author; … … }
use add_action(‘publish_post’, ‘rhb_check_current_user’); and in your rhb_check_current_user function check using the global $post: function rhb_check_current_user(){ global $post; $author_id = $post->post_author; … … }
switch_theme() should work: function myplugin_activate() { switch_theme(‘default’, ‘default’); } register_activation_hook( __FILE__, ‘myplugin_activate’ );
I had a similar problem with radio buttons losing their status when I dragged a metabox on a settings page. I hacked together a workaround and posted it as a reply to the original wordpress trac ticket http://core.trac.wordpress.org/ticket/16972#comment:4
As far as i am aware there is “no” standard each sidebar is defined by the theme itself i would create the elements so that they stretch and wrap in your div and use %’s in your css for associated sizes.
I cleaned up your code, and put all the header information for installing it. Your plugin works fine, I tested it! /* Author: whoever Plugin Name: Some Name Plugin URI: Text Domain: some-domain Version: 1.0 */ function DynamiteSearch($form) { $form = “<form method = ‘get’ id = ‘searchform’ action = ‘ “.site_url().” ‘ >”; $form … Read more
subscriber is a role, not a capability. Use a capability to manage access, e.g. read. To understand the difference better install Justin Tadlock’s plugin Members. For the subscriber role you get a list of capabilities like this: The administrator role in contrast:
Unfortunately Post or object relationships is not possible in WordPress without doing a lot of extra work. This feature is being actively discussed on this trac ticket any additional support for this would help our case of getting this included in core. Your only options are: Use a plugin and modify it to fit your … Read more
what you are looking for is call in the WordPress world a MetaBox and just like Yoast SEO you need to use add_meta_box() function to add your own. there is a great tutorial and class you can use in your plugin at deluxeblogtips.com I would suggest you use that for a starting point.
You don’t need anything WordPress specific here. Use PHP’s str_replace to replace tokens entered by users in the settings. In your plugin code, wherever you are echoing the setting value wrap it in str_replace with the value you want to replace %my_url% with. echo str_replace(“%my_url%”, $real_url_value, $setting_text);
I just wanted to add two small things for other peoples…. if your template supports it you can just add : <?php include (TEMPLATEPATH . ‘/searchform.php’); ?> 2.adding the following code will put a text inside the search box. (like “Write your search and hit Enter” ) <form method=”get” id=”searchform” action=”<?php bloginfo(‘home’); ?>/”> <div><input type=”text” … Read more