Javascript code inside “” in core WordPress files .php

These are Underscore Templates, handled by the wp.template() JavaScript function (source here) which takes in a template ID corresponding to a <script type=”text/html” id=”tmpl-{template ID}”> element containing such code and compiles it into a function. This function can then be executed with the variables used in the template in order to produce a string of … Read more

Adding a post shortcode to a page template?

To use shortcode in a PHP file (outside the post editor) you have the handy little function do_shortcode(); so in your case you use: <?php do_shortcode(‘[mingleforum]’); ?> Update: following the first comment, I figured its publicly known for some reason, if you are expecting output from the shortcode then echo it out. <?php echo do_shortcode(‘[mingleforum]’); … Read more

Using WPAlchemy metabox values in another metabox

Ok, I finally managed to solve that by myself. It is possible thanks to : Create the first field : <?php while($mb->have_fields_and_multi(‘types’)): $mb->the_group_open(); $mb->the_field(‘type’); ?> <input type=”text” id=”<?php $mb->the_name(); ?>” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>” /> <a href=”#” class=”dodelete button”>Remove</a> <?php $mb->the_group_close(); endwhile; ?> <a href=”#” class=”docopy-types button” style=”float: left”>Add new</a> <a href=”#” class=”dodelete-types … Read more

wordpress inserting posts programatically through a url

I finally got the answer to the problem. To make this code work: global $user_ID; $new_post = array( ‘post_title’ => ‘My New Post’, ‘post_content’ => ‘Lorem ipsum dolor sit amet…’, ‘post_status’ => ‘publish’, ‘post_date’ => date(‘Y-m-d H:i:s’), ‘post_author’ => $user_ID, ‘post_type’ => ‘post’, ‘post_category’ => array(0) ); $post_id = wp_insert_post($new_post); we need to make sure … Read more

WordPress and Custom PHP single SignOn

You can integrate the wordpress authentication with the apache webserver and then configure which additional resources need a login on your webserver. This works with PHP as well with HTML and images. For more information, please see mod_auth_mysql and phpass.

How to create Sub Sub domain Multi User blogs?

While this question is several months old and you’ve probably figured something out already, I figured it was worth answering anyway. This is possible to do using the WP Multi Network Plugin. WordPress has the underlying structure to accomplish this, but no accompanying UI — this plugin merely offers that interface. Some things are not … Read more