RCCWP_Application::InWritePostPanel PHP Method

InWritePostPanel() public static method

This function returns true if the user be in the Write Post Page
public static InWritePostPanel ( ) : Bool
return Bool
    public static function InWritePostPanel()
    {
        return strstr($_SERVER['REQUEST_URI'], '/wp-admin/post-new.php') || strstr($_SERVER['REQUEST_URI'], '/wp-admin/post.php') || strstr($_SERVER['REQUEST_URI'], '/wp-admin/page-new.php') || strstr($_SERVER['REQUEST_URI'], '/wp-admin/page.php');
    }

Usage Example

コード例 #1
0
 function FormError()
 {
     global $mf_domain;
     if (RCCWP_Application::InWritePostPanel()) {
         echo "<div id='mf-publish-error-message' class='error' style='display:none;'><p><strong>" . __("Post was not published - ", $mf_domain) . "</strong> " . __("You have errors in some fields, please check the fields below.", $mf_domain) . "</p></div>";
     }
 }
All Usage Examples Of RCCWP_Application::InWritePostPanel