Skip to content

Instantly share code, notes, and snippets.

@Bicarbona
Last active March 30, 2016 22:59
Show Gist options
  • Save Bicarbona/5af5c114a517a70b0b1b to your computer and use it in GitHub Desktop.
Save Bicarbona/5af5c114a517a70b0b1b to your computer and use it in GitHub Desktop.
wp snippets
<?php
/**
*
* @ 28.3.2016 - Get Custom Term ID, Term name, Term description ...
*
**/
global $post;
$terms = get_the_terms( $post->ID , 'custom-term-slug' );
// print_r($terms);
$term_id = $terms[0]->term_id;
echo 'name ' . $terms[0]->name;
echo 'desc ' . $terms[0]->description;
/**
*
* Delete link
*
**/
$delLink = wp_nonce_url( admin_url() . "post.php", "post=" . $post->ID . "&action=trash");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment