i am using this code to create a new page when my plugin is activated:
function create_policy() {
$my_post = array(
'post_title' => 'mobile page',
'post_content' => 'this is my content',
'comment_status' => 'closed',
'post_type' => 'page',
'post_status' => 'publish',
'post_author' => 1,
'post_category' => array( 3,4 )
);
wp_insert_post( $my_post );
}
register_activation_hook( __FILE__, 'create_policy' );
what i want to do is : 1) use my own code in the 'post_content', not regular text. 2) clear all the page and leave only the GET_header i want a blank page with my code.
any advice ?
in addition to the comments:
this is the admin pannel code:
<?php
// create custom plugin settings menu
add_action('admin_menu', 'zeev_create_menu');
function zeev_create_menu() {
//create new top-level menu
add_menu_page('zeev movile redirect', 'zeev mobile', 'administrator', __FILE__, 'zeev_settings_page', 'favicon.ico');
//call register settings function
add_action( 'admin_init', 'register_mysettings' );
}
function register_mysettings() {
//register our settings
register_setting( 'zeev-settings-group', 'zeev_tracking_code' );
}
function zeev_settings_page() {
?>
<div class="wrap">
<form method="post" action="options.php">
<?php settings_fields('zeev-settings-group'); ?>
<table class="form-table">
<tr valign="top">
<td><textarea name="zeev_tracking_code" cols="90"><?php echo get_option('zeev_tracking_code'); ?></textarea></td>
</tr>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>
</form>
</div>
<?php }
and this is the veriable what need to find himself on a blank page someware (and to work)
<?php echo get_option('zeev_tracking_code'); ?>