{"_id":"54326ba8f2f806080098ad58","project":"5431c59ea55723080068e155","category":{"_id":"543264f42aca39080046d81e","__v":27,"pages":["543266122aca39080046d820","5432670f2aca39080046d822","543267462aca39080046d824","5432679bf2f806080098ad46","543267d92aca39080046d826","543267fe2aca39080046d829","543268232aca39080046d82b","543268572aca39080046d82d","5432687d2aca39080046d82f","543268a82aca39080046d831","543268d7f2f806080098ad48","54326901f2f806080098ad4a","5432692bf2f806080098ad4c","54326979f2f806080098ad4e","5432699b2aca39080046d833","543269c3f2f806080098ad50","543269ecf2f806080098ad52","54326a502aca39080046d836","54326a71f2f806080098ad54","54326a8ff2f806080098ad56","5444faf50a8dbc1a00ff6886","54326ba8f2f806080098ad58","546babeab47b5d1400109f34","54d89a8a80fc0e1900b3bda9","54d8a04c80fc0e1900b3bdac","552a942be82c550d00a26407"],"project":"5431c59ea55723080068e155","version":"5431c59ea55723080068e158","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-06T09:46:28.471Z","from_sync":false,"order":3,"slug":"fields","title":"Fields"},"is_link":false,"parentDoc":null,"version":{"_id":"5431c59ea55723080068e158","project":"5431c59ea55723080068e155","__v":8,"createdAt":"2014-10-05T22:26:38.927Z","releaseDate":"2014-10-05T22:26:38.927Z","categories":["5431c59ea55723080068e159","54325f53f2f806080098ad37","543264b1f2f806080098ad3e","543264c8f2f806080098ad3f","543264d3f2f806080098ad40","543264f42aca39080046d81e","5435bbf15e1b20200043834d","54e9cfb4f152c50d009b49ed"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"542ea80e6b0eb6080066c9d5","__v":14,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-06T10:15:04.856Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"settings":"","try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":23,"body":"Adding `posts`\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\n$tea_content = array(\\n    array(\\n        'type' => 'wordpress',\\n        'id' => 'my_posts_field_id',\\n        'mode' => 'posts',\\n        'title' => 'My Wordpress posts',\\n        'options' => array(\\n            'post_type' => array('post', 'my_cpt_1', 'my_cpt_2'),\\n            'numberposts' => 10,\\n        ),\\n        'multiple' => true, //Optional: to \\\"false\\\" by default\\n    ),\\n);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/QsPf1YDZRW94VBzqEny2_wordpress.png\",\n        \"wordpress.png\",\n        \"1234\",\n        \"98\",\n        \"#51628b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ehF5sdJ0TzqqgOspckon_wordpress-2.png\",\n        \"wordpress-2.png\",\n        \"1234\",\n        \"231\",\n        \"#965112\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nAdding `menus`\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\n$tea_content = array(\\n    array(\\n        'type' => 'wordpress',\\n        'id' => 'my_menus_field_id',\\n        'mode' => 'menus',\\n        'title' => 'My Wordpress menus',\\n        'multiple' => true, //Optional: to \\\"false\\\" by default\\n    ),\\n);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\nAdding `pages`\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\n$tea_content = array(\\n    array(\\n        'type' => 'wordpress',\\n        'id' => 'my_pages_field_id',\\n        'mode' => 'pages',\\n        'title' => 'My Wordpress pages',\\n        'multiple' => true, //Optional: to \\\"false\\\" by default\\n    ),\\n);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\nAdding `post types`\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\n$tea_content = array(\\n    array(\\n        'type' => 'wordpress',\\n        'id' => 'my_posttypes_field_id',\\n        'mode' => 'posttypes',\\n        'title' => 'My Wordpress post types',\\n        'multiple' => true, //Optional: to \\\"false\\\" by default\\n    ),\\n);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\nAdding `tags`\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\n$tea_content = array(\\n    array(\\n        'type' => 'wordpress',\\n        'id' => 'my_tags_field_id',\\n        'mode' => 'tags',\\n        'title' => 'My Wordpress tags',\\n        'multiple' => true, //Optional: to \\\"false\\\" by default\\n    ),\\n);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\nAdding `taxonomies`\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\n$tea_content = array(\\n    array(\\n        'type' => 'wordpress',\\n        'id' => 'my_taxonomies_field_id',\\n        'mode' => 'taxonomies',\\n        'title' => 'My Wordpress taxonomies',\\n        'multiple' => true, //Optional: to \\\"false\\\" by default\\n        'options' => array( //Default value is 'category'\\n            'term' => 'category',\\n        ),\\n    ),\\n);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Retrieve data\"\n}\n[/block]\nUsing the `_get_option('my_tags_field_id')` method, you'll get (with a `json_encode()` display):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"25\\\"\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\\"24\\\", \\\"25\\\", \\\"26\\\", \\\"27\\\"]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"wordpress-field","type":"basic","title":"Wordpress"}
Adding `posts` [block:code] { "codes": [ { "code": "<?php\n\n$tea_content = array(\n array(\n 'type' => 'wordpress',\n 'id' => 'my_posts_field_id',\n 'mode' => 'posts',\n 'title' => 'My Wordpress posts',\n 'options' => array(\n 'post_type' => array('post', 'my_cpt_1', 'my_cpt_2'),\n 'numberposts' => 10,\n ),\n 'multiple' => true, //Optional: to \"false\" by default\n ),\n);", "language": "php" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/QsPf1YDZRW94VBzqEny2_wordpress.png", "wordpress.png", "1234", "98", "#51628b", "" ] } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/ehF5sdJ0TzqqgOspckon_wordpress-2.png", "wordpress-2.png", "1234", "231", "#965112", "" ] } ] } [/block] Adding `menus` [block:code] { "codes": [ { "code": "<?php\n\n$tea_content = array(\n array(\n 'type' => 'wordpress',\n 'id' => 'my_menus_field_id',\n 'mode' => 'menus',\n 'title' => 'My Wordpress menus',\n 'multiple' => true, //Optional: to \"false\" by default\n ),\n);", "language": "php" } ] } [/block] Adding `pages` [block:code] { "codes": [ { "code": "<?php\n\n$tea_content = array(\n array(\n 'type' => 'wordpress',\n 'id' => 'my_pages_field_id',\n 'mode' => 'pages',\n 'title' => 'My Wordpress pages',\n 'multiple' => true, //Optional: to \"false\" by default\n ),\n);", "language": "php" } ] } [/block] Adding `post types` [block:code] { "codes": [ { "code": "<?php\n\n$tea_content = array(\n array(\n 'type' => 'wordpress',\n 'id' => 'my_posttypes_field_id',\n 'mode' => 'posttypes',\n 'title' => 'My Wordpress post types',\n 'multiple' => true, //Optional: to \"false\" by default\n ),\n);", "language": "php" } ] } [/block] Adding `tags` [block:code] { "codes": [ { "code": "<?php\n\n$tea_content = array(\n array(\n 'type' => 'wordpress',\n 'id' => 'my_tags_field_id',\n 'mode' => 'tags',\n 'title' => 'My Wordpress tags',\n 'multiple' => true, //Optional: to \"false\" by default\n ),\n);", "language": "php" } ] } [/block] Adding `taxonomies` [block:code] { "codes": [ { "code": "<?php\n\n$tea_content = array(\n array(\n 'type' => 'wordpress',\n 'id' => 'my_taxonomies_field_id',\n 'mode' => 'taxonomies',\n 'title' => 'My Wordpress taxonomies',\n 'multiple' => true, //Optional: to \"false\" by default\n 'options' => array( //Default value is 'category'\n 'term' => 'category',\n ),\n ),\n);", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "Retrieve data" } [/block] Using the `_get_option('my_tags_field_id')` method, you'll get (with a `json_encode()` display): [block:code] { "codes": [ { "code": "\"25\"", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "[\"24\", \"25\", \"26\", \"27\"]", "language": "json" } ] } [/block]