• Hi….

    I was wondering if there is any way we can pass parameters to the “new page” functionality of a wordpress admin.

    what I am doing here is using this code.

    <?php if (current_user_can('level_10')){ ?>
    						Hi Admin! It appears we do not have a page here. Would you like to create one for your users?						Do it <a href="<?php bloginfo('url'); ?>/wp-admin/page-new.php">here!</a>
    						<?php } else { ?>
    						<p>Somehow, you ended up in the wrong place, but don't worry! Instead, try one of the following:</p>
    <?php } ?>

    This is when a user/admin encounters a 404 error on the site.
    The url (that gave the 404 error) is something like
    https://website.com/page-one/child-page
    (and we already have page-one existing in our database, but we do not have its sub-page “child-page”).

    what i want to do here, is when the admin clicks “here” on the 404 page, this “child-page” gets automatically created with the correct parent item, and the admin is displayed a success message along with a link to the page where “child-page” can be edited further… but now, he doesn’t need to specify the parent page since that was done automatically when the page was created.

    Actually the dropdown of parent-pages is getting two messy and this will really help making things better. any help will be greatly appreciated.

  • The topic ‘Passing parameters to wp-admin/page-new.php’ is closed to new replies.