WordPress.org

Ready to get started?Download WordPress

Forums

PHP Code for posts
Page Not Found (6 posts)

  1. bauzer714
    Member
    Posted 9 months ago #

    The below (line 2) is the line that causes my save to become a 404. I saw the other page not found post and do have a custom permalink set. I did change it to the default wordpress sets and tried that, but it still did the same thing. I've also deactivated every plugin with exception of this one, and it also continues to throw me to the 404 page.

    $pattern = '/[^0-9x]/i';
    $phone = preg_replace($pattern, '',$phone);
    <?php
    //This will save
    preg_replace
    ?>
    <?php
    //This will not
    preg_replace()
    ?>

    http://wordpress.org/plugins/php-code-for-posts/

  2. The.Missing.Code
    Member
    Plugin Author

    Posted 8 months ago #

    Hi Bauzer,

    I have tested every combination and cannot recreate your issue.

    Please can you provide more information

  3. bauzer714
    Member
    Posted 8 months ago #

    I have tried everything and continue to have the error with preg_replace(). I can't attribute it to anything and it's a really weird bug. I ended up just making my own function pregReplace() and then using that function in functions.php to get around it. I wish I could provide more details, but frankly - as a developer as well - I'm baffled what would be causing it.

  4. The.Missing.Code
    Member
    Plugin Author

    Posted 8 months ago #

    Is the preg_replace issue within the addition or display of the code?

    In my test i was able to add a snippet within the menu and successfully display it on a page using the shortcode, this is indeed a very strange problem

  5. bauzer714
    Member
    Posted 8 months ago #

    It's with the addition of code. I can take my entire code snippet with pregReplace [my function] and then just replace for preg_replace [php function] and hit save and it'll go to the 404 page upon hitting save.

  6. The.Missing.Code
    Member
    Plugin Author

    Posted 8 months ago #

    Sadly, i have not been able to recreate the issue. do your server error logs show anything?

Reply

You must log in to post.

About this Plugin

About this Topic