wp-shortcake / shortcake

Shortcake makes using WordPress shortcodes a piece of cake.
GNU General Public License v2.0
664 stars 142 forks source link

Exclude self #625

Open szepeviktor opened 8 years ago

szepeviktor commented 8 years ago

I am developing an ultra-simplified page builder. It works by a CPT called blokk. There is a shortcake which lets you pick 1 blokk by post_select on posts and pages and blokks also. So a blokk could contain another blokk.

Could we add $query_args['exclude_self'] to Shortcode_UI_Field_Post_Select to prevent selecting the blokk itself?

szepeviktor commented 8 years ago

I was trying with post__not_in arg but there's no way to tell the post ID at shortcode_ui_register_for_shortcode().

szepeviktor commented 8 years ago

Thinking further the current post ID is not in the AJAX request. I think it'll be difficult. Maybe the solution could be in edit-attribute-field-post-select.js?