Skip to content

Instantly share code, notes, and snippets.

@jtsternberg
Created January 16, 2019 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtsternberg/f03addf336660ee80dbb3f238e41f5c6 to your computer and use it in GitHub Desktop.
Save jtsternberg/f03addf336660ee80dbb3f238e41f5c6 to your computer and use it in GitHub Desktop.
Add additional languages to code-snippet-cpt plugin
<?php
add_action( 'admin_init', function() {
$exists = get_term_by( 'slug', 'xpp', $taxonomy );
if ( empty( $exists ) ) {
$result = wp_insert_term( 'X++', 'languages', array( 'slug' => 'xpp' ) );
wp_die( '<xmp>'. __LINE__ .') $result: '. print_r( $result, true ) .'</xmp>', 'Debug' );
}
wp_die( '<xmp>'. __LINE__ .') $exists: '. print_r( $exists, true ) .'</xmp>', 'Debug' );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment