WordPress.org

Ready to get started?Download WordPress

Forums

wp_schedule_event stripping iframe tags (3 posts)

  1. sloarie
    Member
    Posted 1 year ago #

    Anyone experienced this? I have a plugin that makes a page with an embedded iframe that works great using a regular register_activation_hook(__FILE__,'create_page_with_iframe');
    hook.
    But when I replace it with a CRON hook as such

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    register_activation_hook(__FILE__, 'my_plugin_activation');
      register_deactivation_hook(__FILE__, 'my_plugin_deactivation');
    
      add_action('my_hourly_cron', 'create_page_with_iframe');
    
      function my_plugin_activation () {
      	if (!wp_next_scheduled('my_hourly_cron')) {
      		wp_schedule_event( time(), 'hourly', 'my_hourly_cron');
      	}
      }
    
      function my_plugin_deactivation () {
      	if (wp_next_scheduled('my_hourly_cron')) {
      		wp_clear_scheduled_hook('my_hourly_cron');
      	}
      }

    Then the Cron job works fine, but my created page has the iframe tags stripped out!

    Any tips on how to include both a Cron job AND an embedded iframe in a wordpress plugin?

    Thanks!

  2. sloarie
    Member
    Posted 1 year ago #

    Anybody out there can help me with this? I still haven't been able to figure it out. Thanks!

  3. vicman
    Member
    Posted 1 year ago #

    I am looking for this too. Please let me know if you find solution to this. Thanks you

Topic Closed

This topic has been closed to new replies.

About this Topic