dstofka
Forum Replies Created
-
I would assume that would work, but I’d appreciate seeing a snippet to see how it’s actually invoked.
Thanks for the quick reply! I would think that one of your existing hooks would do the trick but I don’t know enough about how to use them. Something like this —
add_action('usp_insert_after', 'rename_slug_from_custom_field');
function rename_slug_from_custom_field($submission_data) {
$post_id = $submission_data['id']; // Get the post ID
$post = get_post($post_id);
$slug = get_post_meta($post_id, 'usp_custom_field__slug', true);
wp_update_post([
'ID' => $post_id,
'post_name' => $slug,
]);
}— yielded the correct $post_id for the new post but I wasn’t able to actually retrieve the post to update its slug.
I also tried using the ‘usp_new_post’ hook but it kept throwing a fatal error having to do with parameters so I was probably implementing it incorrectly.
Update: I was able to prevent the Fatal Error mentioned above if I modified
admin.phparound line 924 …from:
list( $columns, $hidden ) = $wp_list_table->get_column_info();
to:
if (is_callable(array($wp_list_table, 'get_column_info')))
list( $columns, $hidden ) = $wp_list_table->get_column_info();
else
$columns = $hidden = array();
Practically speaking, this prevents the
$columnsand$hiddenvariables from being set, but I’m not sure what this section of code does anyway. Is there a better workaround?Possible workaround or clue to fixing this problem….
I too recently found all my CPT-onomy checkboxes being disabled as described above. (This was a new install, so I don’t know if it was version-related.) After trying a bunch of different things — looking for plugin conflicts, manually editing the plugin code — I finally discovered that the glitch seemed to be related to the SLUG of the custom post type that was being registered as a CPT-onomy.
My custom post types that were set up with a HYPHEN in their slugs DIDN’T WORK as CPT-onomies (their checkboxes were disabled). When I edited my CPTs so the slugs had NO HYPHENS (a-z only), the checkboxes worked.
Hope this helps!
Forum: Plugins
In reply to: [Theme My Login] Adding Featured Image support to tml_page?Thanks … that did the trick!
… And it seems like I’m finally getting everything working again with your plugin.