• Is there an established method for making a custom page for use in a Thickbox iframe?

    Or if not specifically for Thickbox, then an admin page that displays without the side menus and footer and header, etc etc.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    I’ve escaped out of the admin environment by adding admin pages as usual that call a function that is to display the page. That function basically does this:
    echo "<script>window.location.assign('$path');</script>";

    Thread Starter RobotHero

    (@robothero)

    That’s not quite what I meant. The only javascript I’m calling is for the Thickbox, and that works fine.

    I’m trying out approaching from the other direction like they’re talking about here:
    https://wordpress.stackexchange.com/questions/97742/bare-minimum-to-include-in-php-file-to-use-wp-functions

    Moderator bcworkz

    (@bcworkz)

    To be completely proper, one should never directly include wp-load.php or any specific core file or files from their PHP code page. It should be the other way around, the WP environment includes your code page by the nature of a particular request. Attempting to do it the other way around in a plugin or theme submitted to the WP repository will get it kicked back to you unaccepted. The reason is the relative relationship between your code page and the specific core files can vary by installation.

    Of course, if you’re not interested in the repository and are coding only for your own site, you can do whatever your like, but you should not expect that kind of advice here.

    I somehow managed to omit the salient point of the method I was suggesting above. It wasn’t so much the javascript as that $path pointed to a specific page based on a custom template. That template would be derived from whatever PHP code you are trying to execute. When requesting such a page, through whatever method, the WP environment is loaded for you as part of the page template loading process.

    My apologies for completely omitting my primary point, you’re not the mind reader I thought your were ??

    Thread Starter RobotHero

    (@robothero)

    If I’m following you I’d create a dummy page using this custom template and then use the path for that page?

    I can pass any path I want to tb_show() so yeah, calling window.location.assign seemed to be addressing the least difficult part of my problem. ??

    I would have done just an inline Thickbox with an AJAX form but I have to deal with media attachments which is simpler through a non-AJAX form.

    Moderator bcworkz

    (@bcworkz)

    Yes, I believe we’re on the same track now. I wouldn’t call it a dummy page in that it has its own permalink and its template does real stuff. It is a dummy page in the sense of when you add it, all you need to provide is a title from which to create a permalink. The content and whatever is not used unless your template is specifically setup to run a loop and use it. FWIW, I never use loop content for such pages, any content comes directly from the template itself, not the DB.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Making custom admin page for use in Thickbox?’ is closed to new replies.