Jump to content

Archived

This topic is now archived and is closed to further replies.

wpappdev

Audio Player custom post type conflict resulting in 404

Recommended Posts

wpappdev+    0
wpappdev

Hi Aleksander,

 

While troubleshooting a custom post type registration issue that was resulting in 404's, we discovered that audio-player flushes rewrite rules in the post_type_setup function which is called by section_persistent. Our custom post type registration calls flush_rewrite_rules() only on plugin activation after it is registered and it appears that the call by audio-player (on every page load?) resets it resulting in 404's on our new post type.

 

 

 Here is how our post type is registered and activated ($args not included for sake of brevity)

function create_wpappdev_cpt() {
  $args = //args are added here, labels, description, rewrite, etc;

  register_post_type( 'wpappdev_cpt', $args )

}
 
add_action( 'init', 'create_wpappdev_cpt' );

function activate_wpappdev_cpt() { // register custom post type create_wpappdev_cpt(); // flush rewrite rules flush_rewrite_rules( false ); }
register_activation_hook( __FILE__, 'activate_wpappdev_cpt' );
 

 

 

With this setup, if audio-player is activated, our custom post results in a 404. After audio-player is disabled, and after a visit to the permalinks page to flush rewrites, our custom post type works fine.

 

 

I see the audio-player custom post type is registered with the PageLinesPostType class, which I am not familiar with. Is it possible to flush_rewrite_rules on activation and deactivation only?
 
Thanks,
 
Justin

 

Share this post


Link to post
Share on other sites
ahansson89    57
ahansson89

Hi Justin,

In the latest version I have removed the flush_rewrite_rules() as I discovered that it actually wasnt needed.

I am not able to push any updates through the store at the moment, but I have setup my own store at http://shop.ahansson.com which features auto updates.

Share this post


Link to post
Share on other sites

  • Similar Content

    • rafales
      By rafales
      Hello,
       
       
      Before buying Audio Player, I would like to know if it can play audio streaming.
       
      For exemple : http://37.59.53.200:9016/autodj
       
      Thanks for your help.
       
      Best.
       
       
      Rafales
    • outtareach
      By outtareach
      Installed and updated the plugin and could barely use wordpress.  I did a scan and the speed was a D, I deactivated it and deleted it and now performance is better and backend loads better.  Uninstalled all other plugins til I got to that and it is what was slowing site down.  Just wanted to let you know.
    • pehja
      By pehja+
      The videobackground is really usefull. But would it be possible to have it contained in a section? Like on this site. http://www.izettle.com/se/kassaregister
       
      Would be perfect!
       
      Ops sorry put this in the wrong place...
    • pehja
      By pehja+
      Hi Alex!
       
      So the player still is out of order. And the one you have pushed is empty so there is no way to install the latest version. The latest in PageLine account is 100.4
       
       
×