Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter brianduffey

    (@brianduffey)

    Sounds great. I am happy to assist with any development, if needed. Let me know and thanks for your hard work on a very useful plugin! ??

    Thread Starter brianduffey

    (@brianduffey)

    My bad, I see now that it is a manual process, not an automatic one. I see your FAQ comment about the scheduling of this, however it seems to me from my quick glance over the plugin code that you could very easily add a filter into the publish post hook, which will call your function with the current post ID.

    Something perhaps like:
    add_filter('publish_post', 'send_post_notif_ajax_handler');

    …and then just modify the send_post_notif_ajax_handler function to accept post ID as a parm, instead of getting it from the AJAX post. In fact, doing this could allow you to easily add a setting to control if it is done automatically or not, I would think.

    In any case, it does seem like it is working now, so I can demo it to the site owner to see if the manual process is acceptable. Thanks for your help!

    Thread Starter brianduffey

    (@brianduffey)

    Hi Devon,

    Thanks for your reply. In full disclosure, I inherited this WP site so it is possible there is some bad config that exists that I haven’t discovered yet. And you are right that it is easy enough to ignore since I won’t be importing often. However, a bigger concern is if other things were not working as well as a result of whatever the issue here is.

    For instance, we publish a new post every single night. I set this up yesterday and added my email as a subscriber, however I did not get notified when the post was published last night. The email is working as I did get the subscribe confirmation and subscription confirmed emails, so I am not sure what to check.

    I am fine with ignoring the initial error, however do you have any thoughts on what to check for the new post email? The site is hosted on dreamhost, and the logs folder seems to be empty, so I just now manually configured wp-config to log errors somewhere else, so I won’t see errors, if any, until after the post is published tonight.

    Thread Starter brianduffey

    (@brianduffey)

    Never mind, I figured it out. In case someone else finds this post in the future, here is the code I used to create my plugin:

    <?php // hook required to populate blank page
    add_filter('the_content', 'mrc_category'); // check each page for content
    
    // Executes before each page is displayed.
    function mrc_category( $content ) {
    
    	// check if the page is blank
    	if (get_the_content() == '') {
    	$content="<!-- Begin Content -->\n\n" . eval(require 'C:\website\docs\wp-content\plugins\mrc-toc\subpages.php') . "\n\n<!-- End Content -->";
    }
    
    	return $content;
    } ?>

    Where subpages.php is my php code I wrote to list the children. Hope this helps someone!

Viewing 4 replies - 1 through 4 (of 4 total)