ID, 'angularjsLoad', true );
$angularLoad = false;
if($value == "1") { $angularLoad = true; }
echo '
';
echo '';
}
function angularSave( $post_id ) {
// Check if our nonce is set.
if ( ! isset( $_POST['myplugin_meta_box_nonce'] ) ) {
return;
}
if ( ! wp_verify_nonce( $_POST['myplugin_meta_box_nonce'], 'myplugin_meta_box' ) ) {
return;
}
// If this is an autosave, our form has not been submitted, so we don't want to do anything.
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
// Check the user's permissions.
if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {
if ( ! current_user_can( 'edit_page', $post_id ) ) {
return;
}
} else {
if ( ! current_user_can( 'edit_post', $post_id ) ) {
return;
}
}
if ( ! isset( $_POST['angularjsLoad'] ) ) {
return;
}
// Sanitize user input.
$my_data = sanitize_text_field( $_POST['angularjsLoad'] );
// Update the meta field in the database.
update_post_meta( $post_id, 'angularjsLoad', $my_data );
}
add_action( 'save_post', 'angularSave' );