stereoscott
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Post Type Maker] Overwrites other post type rewrite rulesBy the way, I’ve been using a plugin to output the rewrite rules in a friendly way in the admin area to help with debugging. http://wordpress.org/extend/plugins/monkeyman-rewrite-analyzer/
Forum: Plugins
In reply to: [Custom Post Type Maker] Overwrites other post type rewrite rulesThanks Jorn, I’ve been exploring this issue myself. I wonder if it has something to do with the order in which the plugins are loaded.
A simple way to reproduce the issue would be to create a super simple plugin with a generic custom post type, activate it, and see if the rewrite rules work. I’ve done just that. Here is the plugin file:
<?php /* Plugin Name: Custom Post Type Test Author: Scott Meves Version: 1.0 */ //avoid direct calls to this file, because now WP core and framework has been used if ( !function_exists('add_action') ) { header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit(); } if ( !class_exists( 'PostTypeTest' ) ) { class PostTypeTest { function PostTypeTest() { register_post_type( 'custom_post_type', array( 'labels' => array( 'name' => __( 'Custom Name' ), 'singular_name' => __( 'Singular Name' ) ), 'public' => true, 'rewrite' => array('slug' => 'custom-url-here', 'with_front' => false), 'hierarchical' => false, 'capability_type' => 'post', 'has_archive' => false, 'publicly_queryable' => true, 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes') ) ); } } // end class // Initiate the plugin add_action("init", "PostTypeTestInit"); function PostTypeTestInit() { global $the_customPostType; $the_customPostType = new PostTypeTest(); } }When I add this simple plugin, and deactivate the “Custom Post Type Maker” plugin, and then re-save the permalink settings / flush the rewrite rules… sure enough my custom rewrite rule works just fine (“/custom-url-here/…”).
But if I activate the “Custom Post Type Maker” plugin again, the other custom post type rules disappear.
Forum: Plugins
In reply to: [Plugin: Audio Player] Adding an event listenerJust ran into this same error tonight. @cbarnardo, did you find a solution?
Forum: Fixing WordPress
In reply to: Version 2.9 image editor not workingFor me, the issue was that in my custom theme I was including additional javascripts (like prototype) with wp_enqueue_script inside functions.php.
The solution was to only include those scripts on the frontend and not the admin area so that there would be no javascript errors while using the built-in media crop tool (“g.push is not a function”).
To do this (i.e. add javascripts to the frontend of your theme and not the admin area), hook into the ‘get_header’ action, like so:
add_action('get_header', 'my_register_javascripts'); function my_register_javascripts() { wp_register_script('my-custom-js', get_bloginfo('template_url').'/js/my-custom-js.js', array('prototype')); wp_enqueue_script('my-custom-js'); }