advanced-custom-fields

Apply CKEditor Advanced Content Filter to a string

假装没事ソ 提交于 2019-11-29 12:38:09
How can I apply CKEditor's Advanced Content Filter to a string? I'm trying to intercept pasted content using editor.on('paste', ...), get its ACF-filtered value, and then apply my own transformations to the filtered value. After this point, it's okay if it runs through the ACF again. I reported recently a ticket which I think you'll find interesting: http://dev.ckeditor.com/ticket/11621 . There's a pretty high chance that this feature will be introduced in CKEditor 4.5. ( Edit : This feature got to CKEditor in 4.5 – CKEDITOR.config.pasteFilter ). As for your question - to apply ACF to an HTML

How to get Advanced Custom Fields field key from WordPress database?

前提是你 提交于 2019-11-29 11:47:13
问题 I’m using Advanced Custom Fields with post-type. I have some select custom fields, and I want to show all the label choices from each field. I’ve tried this way. $field = get_field_object('hair_color'); $hair = $field["choices"]; foreach($hair as $value){ Doing a var_dump($field) it appears empty: array(18) { ["key"] => string(16) "field_hair_color" ["label"] => string(0) "" ["name"] => string(10) "hair_color" ["_name"] => string(10) "hair_color" ["type"]=> string(4) "text" ["order_no"]=> int

ACF relationship fields - get_field values from other post type

此生再无相见时 提交于 2019-11-29 07:02:19
In my POSTS page (regular post type), I have setup a ACF relationship field. Inside this I can select company name which are all under the post type of directory_listings. Now, I have the following code on the directory listings page, and therefore using simply get_field does not work because those values are not on this page, they are elsewhere on the POST type instead. So unsure how to grab the information. Code on one of the pages which is under the DIRECTORY_LISTINGS post type: $posts = get_field('related_articles'); if( $posts ): ?> <ul> <?php foreach( $posts as $post): // variable must

Add ACF fields to search results page WordPress

雨燕双飞 提交于 2019-11-28 12:50:43
I have a file named search.php, where all the search results are added. The search form is located on the homepage. The problem is, I have no special page for the search results, but I want to add ACF fields to this page. I have searched in the dropdown menu 'location' in the ACF plugin, but I can't find the search.php file to add groups to. I am sorry if my explaination is a bit vague, but I don't know how to explain this exactly. Summary, I want to add ACF fields to my search.php search results page. Terminology: ACF stand for the Advanced Custom Fields plugin in WordPress. You can also do

Apply CKEditor Advanced Content Filter to a string

我与影子孤独终老i 提交于 2019-11-28 06:33:15
问题 How can I apply CKEditor's Advanced Content Filter to a string? I'm trying to intercept pasted content using editor.on('paste', ...), get its ACF-filtered value, and then apply my own transformations to the filtered value. After this point, it's okay if it runs through the ACF again. 回答1: I reported recently a ticket which I think you'll find interesting: http://dev.ckeditor.com/ticket/11621. There's a pretty high chance that this feature will be introduced in CKEditor 4.5. ( Edit : This

ACF relationship fields - get_field values from other post type

允我心安 提交于 2019-11-28 00:37:06
问题 In my POSTS page (regular post type), I have setup a ACF relationship field. Inside this I can select company name which are all under the post type of directory_listings. Now, I have the following code on the directory listings page, and therefore using simply get_field does not work because those values are not on this page, they are elsewhere on the POST type instead. So unsure how to grab the information. Code on one of the pages which is under the DIRECTORY_LISTINGS post type: $posts =

Add ACF fields to search results page WordPress

邮差的信 提交于 2019-11-27 07:12:44
问题 I have a file named search.php, where all the search results are added. The search form is located on the homepage. The problem is, I have no special page for the search results, but I want to add ACF fields to this page. I have searched in the dropdown menu 'location' in the ACF plugin, but I can't find the search.php file to add groups to. I am sorry if my explaination is a bit vague, but I don't know how to explain this exactly. Summary, I want to add ACF fields to my search.php search