I've written a hook in my functions file that adds a metabox, from an installed plugin, to a custom post type that I've created. The metabox appears fine, but the default selection that is checked in the metabox is "index,follow" whereas I would like it to be "noindex,nofollow" by default. Is there anyway to change the plugins function using my hook?
My hook:
function robotsmeta_add_custom_box() {
add_meta_box('robotsmeta','Robots Meta',array('RobotsMeta_Admin','noindex_option_fill'),'secured-area','side');
}
add_action('add_meta_boxes', 'robotsmeta_add_custom_box');
Plugin's noindex_option_fill function:
function noindex_option_fill() {
global $post;
$robotsmeta = $post->robotsmeta;
if (!isset($robotsmeta) || $robotsmeta == "") {
$robotsmeta = "index,follow";
}
?>
<label for="meta_robots_index_follow" class="selectit"><input id="meta_robots_index_follow" name="robotsmeta" type="radio" value="index,follow" <?php if ($robotsmeta == "index,follow") echo 'checked="checked"'?>/> index, follow</label><br/>
<label for="meta_robots_index_nofollow" class="selectit"><input id="meta_robots_index_nofollow" name="robotsmeta" type="radio" value="index,nofollow" <?php if ($robotsmeta == "index,nofollow") echo 'checked="checked"'?>/> index, nofollow</label><br/>
<label for="meta_robots_noindex_follow" class="selectit"><input id="meta_robots_noindex_follow" name="robotsmeta" type="radio" value="noindex,follow" <?php if ($robotsmeta == "noindex,follow") echo 'checked="checked"'?>/> noindex, follow</label><br/>
<label for="meta_robots_noindex_nofollow" class="selectit"><input id="meta_robots_noindex_nofollow" name="robotsmeta" type="radio" value="noindex,nofollow" <?php if ($robotsmeta == "noindex,nofollow") echo 'checked="checked"'?>/> noindex, nofollow</label><br/>
<?php
}