Last active
February 1, 2025 00:42
-
-
Save rveitch/1eb0214ab5c0a67fe4eaa5424722219c to your computer and use it in GitHub Desktop.
CoSchedule WordPress Plugin - Get Full Post Example (Debug Bar Console)
This file contains hidden or 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 | |
| // Debug the CoSchedule Plugin | |
| $post_id = 522; // Replace this ID with an ID of a post you want to check. | |
| if (class_exists( 'TM_CoSchedule' )) { | |
| $coschedule = new TM_CoSchedule; | |
| $full_post = $coschedule->get_full_post( $post_id ); | |
| echo '$full_post:<br><pre>'; print_r(json_encode($full_post, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT)); echo '</pre><br><br>'; | |
| } else { | |
| echo 'Class does not exist.'; | |
| } | |
| // Debug the Upload Directory | |
| $upload_dir = wp_upload_dir(); | |
| echo '$upload_dir:<br><pre>'; print_r(json_encode($upload_dir, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT)); echo '</pre>'; | |
| ?> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uses the Debug Bar and Debug Bar Console plugins.
The TM_CoSchedule class calls the
get_full_post()function, which callsget_thumbnail()andget_attachements();Custom Build V2 Changes
