Plugin could not be activated because it triggered a fatal error, unexpected ‘[‘
This part triggers it: = [“widget_text-$id”] Copy paste gone wrong or something? Square brackets used this way make no sense to PHP.
This part triggers it: = [“widget_text-$id”] Copy paste gone wrong or something? Square brackets used this way make no sense to PHP.
Try this: get_terms( ‘category’, “child_of=$parent&fields=ids” ); // should return an array containing the ID’s of children of term $parent
add_action(‘add_meta_boxes’, ‘add_testbox’); function add_testbox() { add_meta_box( ‘testmetabox’, ‘Test Meta Box’, ‘testmetabox_content’, ‘post’, ‘side’, ‘low’); } function testmetabox_content() { echo “hi”; } You can drag and drop the box into the spot you want it to display. Make sure you always wrap the add_meta_box() function in another function, then hook that in like I showed. If … Read more
Where are you putting the wp_schedule_event() code? My guess is, you have it somewhere that’s causing it to run on every page load, causing the action to be scheduled multiple times (like maybe you just dropped it in your functions.php?). You only need to schedule the action once. The easiest way is to do it … Read more
The code below retrieves the custom post type of the currently displayed content and then decides wheter to print on of your stylesheets. Everything happens depending on your page name. You could also var_dump($ctp_obj_name); or printr($ctp_obj_name); and look what else the custom post type object has to offer and decide what you’ll use instead of … Read more
Try this: $output = array(); foreach($gotTags as $tag) $output[] = $tag->name; echo implode(‘,’, $output);
Try using the get_page_by_path() function (Codex ref). So, something like: $mypage = get_page_by_path( ‘page-slug’ ); $mypageid = ( $mypage ? $mypage->ID : ‘0’ ); Then, the post_parent argument becomes: ‘post_parent’ => $mypageid
Link category is a simple taxonomy just like categories , named: link_category so to add one you can use wp_insert_term() eg: wp_insert_term( ‘My link category’, // the term ‘link_category’, // the taxonomy array( ‘description’=> ‘this is a description.’, ‘slug’ => ‘my-link-category’ ) ); and to make all this happen on plugin activation take a look … Read more
You need to add the mime type to the whitelist of allowed file types. Assuming this one still works, you can go the plugin route using. http://wordpress.org/extend/plugins/pjw-mime-config/ Alternatively if you want to add your own mimes in code form, here’s an example. add_filter( ‘upload_mimes’, ‘your_custom_mimes’ ); function your_custom_mimes( $mimes ) { $mimes[‘extensionhere’] = ‘mimetype/goes-here’; return … Read more
Enqueues are not piling up if done multiple times (that is kinda the point of having a queue). As for registration – frankly it shouldn’t be done by most (public) plugins. WordPress comes with jQuery to use and when that copy is re-registered to something else – it affects all plugin and theme code that … Read more