Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data from advanced custom fields #7

Open
h3llr4iser opened this issue Nov 7, 2019 · 1 comment
Open

Add data from advanced custom fields #7

h3llr4iser opened this issue Nov 7, 2019 · 1 comment

Comments

@h3llr4iser
Copy link

h3llr4iser commented Nov 7, 2019

Hello,

I need to add data from plugin ACF (https://www.advancedcustomfields.com/) to the Page Model. Wordpress have a plugin to expose data from ACF (https://github.com/airesvsg/acf-to-rest-api):

{
    "id": 1,
    "date": "2019-11-07T13:10:27",
    "date_gmt": "2019-11-07T12:10:27",
    "guid": {
      "rendered": "http:\/\/localhost:8000\/?p=1"
    },
    "modified": "2019-11-07T14:16:37",
    "modified_gmt": "2019-11-07T13:16:37",
    "slug": "hola-mundo",
    "status": "publish",
    "type": "post",
    "link": "http:\/\/localhost:8000\/hola-mundo\/",
    "title": {
      "rendered": "\u00a1Hola, mundo!"
    },
    "content": {
      "rendered": "\n<p>test<\/p>\n",
      "protected": false
    },
    "excerpt": {
      "rendered": "<p>test<\/p>\n",
      "protected": false
    },
    "author": 1,
    "featured_media": 0,
    "comment_status": "open",
    "ping_status": "open",
    "sticky": false,
    "template": "",
    "format": "standard",
    "meta": [],
    "categories": [
      1
    ],
    "tags": [],
    "acf": {
      "custom_field_1": "test 1",
      "custom_field_2": "test 2"
    }
}

 "acf": {
      "custom_field_1": "test 1",
      "custom_field_2": "test 2"
    }

I am thinking what would be the best option to add this to your bundle. The easy way is to modify the Page Model adding a new property $acf.

Ca I do a pull request with this modification?

Another possibility is to add to the bundle configuration and option to override models.

thx.

@karameloso
Copy link

I forked and added ACF and Yoast data. Check it out: https://github.com/Passion4/symfony-wpblog

Submitting a merge request....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants