Fix rewrite support + add missing image

parent 61d32555
......@@ -119,7 +119,11 @@ if(!class_exists('SH_PostTypes')) {
if(!array_key_exists($DEFAULTSLUG.'/([^/]+)/?$', $rules)) {
update_option('need_rewrite_flush', 1);
sexhack_log("REWRITE: Need to add and flush our rules!");
} else {
sexhack_log("WE DON'T NEED REWRITE!!!!!!!!!!!!!!!!!!!!!!");
//sexhack_log($rules);
}
}
public static function add_rewrites()
......@@ -154,7 +158,7 @@ if(!class_exists('SH_PostTypes')) {
//update_option('need_rewrite_flush', 1);
sexhack_log($wp_rewrite->wp_rewrite_rules());
//sexhack_log($wp_rewrite->wp_rewrite_rules());
}
......
......@@ -489,7 +489,9 @@ if(!class_exists('SexHackMe_Plugin')) {
// Initialize Custom post_types
add_action( 'init', array( 'wp_SexHackMe\SH_PostTypes', 'init'));
add_action( 'sh_rewrite_flushed', array( 'wp_SexHackMe\SH_PostTypes', 'add_rewrites') );
//add_action( 'sh_rewrite_flushed', array( 'wp_SexHackMe\SH_PostTypes', 'add_rewrites') );
//add_action( 'sh_before_rewrite_flush_rules', array( 'wp_SexHackMe\SH_PostTypes', 'add_rewrites') );
add_action( 'init', array( 'wp_SexHackMe\SH_PostTypes', 'add_rewrites'));
// Initialize shortcodes
add_action( 'init', array( 'wp_SexHackMe\SH_Shortcodes', 'init' ) );
......@@ -552,6 +554,7 @@ if(!class_exists('SexHackMe_Plugin')) {
if( get_option('need_rewrite_flush'))
{
sexhack_log("FLUSHING REWRITE RULES");
do_action('sh_before_rewrite_flush_rules');
//flush_rewrite_rules(false);
flush_rewrite_rules();
update_option('need_rewrite_flush', 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment