Forum Replies Created
-
AuthorPosts
-
SteveKeymasterThis is the way WordPress works. It has nothing to do with Piklist. If you want WordPress to process your shortcodes then you need to output with the filter. It’s the WordPress way
SteveKeymasterIf you want WordPress to render your shortcode on the front of your site, you need to use this WordPress filter:
https://developer.wordpress.org/reference/hooks/the_content/Something like this should work:
$speaker_request = get_post_meta($post->ID, 'your-custom-field-name'); echo apply_filters('the_content', $speaker_request);The standard WordPress editor automatically calls this filter, but you need to do it manually,
This will not fix the shortcode not rendering properly in the admin, but it will work on the frontend.
SteveKeymasterHow are you outputting the shortcode in the front of your site?
SteveKeymastermarking resolved.
SteveKeymasterTo get $attachment_id you would need to write some JS to detect the id of the image.
Or I guess you can also save the image to the post_meta table and get the id there. You could run a filter on
save_postas 9999, and pull the meta after it’s saved. Totally untested… 😉
SteveKeymasterEverything about Piklist is done the WordPress way including retrieving data. You can use the native WordPress function get_post_meta to retrieve the attachment information.
As for matching the WP featured image field name… if you are replacing the default WordPress field, then you need to use the same field name.
SteveKeymasterThere is no place in the default WordPress
posttable to save attachment data.
SteveKeymasterThis will be fixed in the next version of Piklist. Pull request was accepted today:
https://github.com/piklist/piklist/pull/110#issuecomment-407831586
SteveKeymasterYup… You need to remove the default featured image metabox or else you are duplicating the field.
This doc explains how to remove it: https://piklist.github.io/docs/faq/fields-not-saving/
Just replace
custom-fieldswiththumbnailandpostwith your CPT.
SteveKeymasterCan you post the code thats creating the salesforce shortcode? A good place to post is: https://gist.github.com/
SteveKeymasterIf you look in the tutorial towards the end it says this:
“So if you look at the book’s meta, you won’t see anything added about the chapter. Why? Because it’s not designed to put anything there. Look at the chapter’s meta. You should find it there. For this reason, you don’t need to specify a field, as relate fields are a special type which store in their own way. In short, the owned object stores the meta.”You need to use
'relate' => 'belongs'and'relate' => 'has'
SteveKeymaster@redsoxfan99– Welcome to the Piklist community! We’re here to help.
I’m not clear on the second screenshot. Is it partially rendering the shortcode?
If you place the shortcode in the TEXT tab, instead of VISUAL, does it work better?
SteveKeymasterI’ll look into the original revision ticket.
However, if you want to disable on a per post basis you can do something like this (untested):
add_action( 'wp_head', 'remove_my_action' ); function remove_my_action(){ global $post; if($post->ID == $id_I_want_to_disable) { remove_action( 'save_post', array( 'piklist_revision', 'save_post' ), -1 ); } }
SteveKeymasterThe featured image demo is the way to go. Not sure why all three images are the same. I just tested and it works fine.
Does the featured image box work in the demos?
SteveKeymasterA pull request has been submitted for this issue:
https://github.com/piklist/piklist/pull/110 -
AuthorPosts