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
//thanks to https://gist.github.com/sultann/24baa5483b4632c3cf214a8de5648204#file-ld-auto-mark-complete-php-L17 for most of | |
//this code, i just corrected it to work with ld_lesson_tag to grab the tags as the original version returned empty | |
//array since it was looking for standard wp tags | |
function ld_is_tagged($postId) { | |
//get all learndash tags on post | |
$tags = wp_get_post_terms($postId,'ld_lesson_tag'); | |
foreach ($tags as $tag) { | |
//need to check for auto-mark-complete tag exists on this post |
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 | |
add_action('admin_init', 'foo_duplicate_posts', 99999); | |
function foo_duplicate_posts(){ | |
// Only allow admins to run the script | |
if(!current_user_can('manage_options')) | |
return; | |
// Check if keyword is set | |
if(!isset($_GET['duplicate-posts'])) |