Support » Plugin: WP Academic Publications » WSOD: v1.2 & WP 5.0.x & PHP 7.3

  • Drivingralle

    (@drivingralle)


    In WP 5.0.x and this plugin in Version 1.2 the screen to create new posts have a WSOD. This error doesn’t create any logs inside the PHP errro log.

    the reason for it is that the flush_rewrite_rules() function is called incorecctly. The function should never be called on every page load as done in v1.2 of this plugin.
    https://codex.wordpress.org/Function_Reference/flush_rewrite_rules

    To fix this open this file:
    wp-content/plugins/wp-academic-publications/wpap-publication.php
    Remove the flush_rewrite_rules(); part from line 53.
    Add the following snippet at the end of the file before the ?> or right into line 56:

    // Flush rewrite on plugin activation
    	function wpap_flush_rewrites() {
    		// call your CPT registration function here (it should also be hooked into 'init')
    		wpap_create_publication();
    		// flush the rules
    		flush_rewrite_rules();
    	}
    	register_activation_hook( __FILE__, 'wpap_flush_rewrites' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘WSOD: v1.2 & WP 5.0.x & PHP 7.3’ is closed to new replies.