Skip to content

Commit

Permalink
Unhook content migration functions from hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
misfist committed May 18, 2017
1 parent 1f2f830 commit e854882
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions includes/utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,10 @@
* @license GPL-2.0+
*/

/**
* Run Once
* Runs function once
* *
* @since 1.0.0
*/
if ( isset( $_GET['run_tni_copy_custom_fields'] ) && ! get_option( 'tni_copy_custom_fields_complete' ) ) {
add_action( 'init', 'tni_copy_custom_fields', 10 );
add_action( 'init', 'tni_copy_custom_fields_finished', 20 );
} elseif ( isset( $_GET['run_tni_copy_custom_fields'] ) && get_option( 'tni_copy_custom_fields_complete' ) ) {
die( "Script already run." );
}

/**
* Copy Custom Fields
* Copies meta field data from `_additional_content_*` fields to new custom fields
* @usage http://yourdomain.com/?run_tni_copy_custom_fields
* @usage run using WP-CLI `wp eval 'tni_copy_custom_fields();'`
*
* @since 1.0.0
*
Expand Down Expand Up @@ -58,7 +45,6 @@ function tni_copy_custom_fields() {
}

}
add_action( 'init', 'tni_copy_custom_fields', 10 );

/**
* Set Guest Account Roles
Expand Down Expand Up @@ -107,13 +93,3 @@ function tni_core_assign_guest_author_roles() {
echo "DONE";

}

/**
* Add `tni_copy_custom_fields_complete` Once Function is Run
*
* @since 1.0.0
*/
function tni_copy_custom_fields_finished() {
add_option( 'tni_copy_custom_fields_complete', 1 );
die( "Script finished." );
}

0 comments on commit e854882

Please sign in to comment.