Last active
March 30, 2016 22:59
-
-
Save Bicarbona/5af5c114a517a70b0b1b to your computer and use it in GitHub Desktop.
wp snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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