Coder Social home page Coder Social logo

Comments (7)

vinkla avatar vinkla commented on June 2, 2024

In simple terms WordPlate is basically a different folder structure for WordPress. It should work as any other WordPress installation.

from wordplate.

steve-ref avatar steve-ref commented on June 2, 2024

Well...
It's not really the kind of answer I was expecting.

Normally I should be able to have this code structure :

`
add_action( 'acf/include_fields', function() {
if ( ! function_exists( 'acf_add_local_field_group' ) ) {
return;
}

acf_add_local_field_group( array(
'key' => 'group_65d314a11e8d3',
[... all the field group attributes]
'show_in_rest' => 1,

) );
} );
`

But I can't see anywhere where it's declared like that.
Even functions.php isn't in the available files

from wordplate.

fiskhandlarn avatar fiskhandlarn commented on June 2, 2024

@steve-ref it's kind of hard to understand what your issue is imo. retrieving acf content via rest should be the same whether you're using wordplate or plain wordpress. have you tried the code above in your application? have you tried within a new wordpress installation (without wordplate)?

why are you even expecting the code to be present in your codebase if you're implementing a non-existent feature?

afaik acf/include_fields is a acf pro feature, and it looks like it should be used from within plugins (the manual doesn't mention it either). do you have acf pro installed? have you tried the code above without the filter?

from wordplate.

steve-ref avatar steve-ref commented on June 2, 2024

@fiskhandlarn
Actually, I don't think I understand how ACF works with Wordplate.

If I understand correctly, to create my blocks, I need to call upon the different PHP files present in the Wordplate folder (for example: WysiwygEditor.php).

This means that in the project I've been assigned, I end up with a line of code like this: WysiwygEditor::make('something', 'something').

My question was whether there is a resource available for enabling the "Show in REST API" option for Wordplate because I don't have access to the user interface to do it in my WordPress admin with Wordplate (it works fine with another installation).

On a fresh WordPress installation with ACF PRO, I can either create my ACF fields and activate "Show In REST API" via the user interface or through functions.php, but I don't have access to either method with Wordplate (I don't have a functions.php, nor a checkbox in the admin).

Sorry for all these questions, I'm just trying to understand how it works.

from wordplate.

fiskhandlarn avatar fiskhandlarn commented on June 2, 2024

@steve-ref

@fiskhandlarn Actually, I don't think I understand how ACF works with Wordplate.

i think they work just fine together. :)

My question was whether there is a resource available for enabling the "Show in REST API" option for Wordplate because I don't have access to the user interface to do it in my WordPress admin with Wordplate (it works fine with another installation).

it seems to me that you are confusing this package with vinkla/extended-acf. eitherway, all properties available in the wp-admin gui for acf is available programmatically, so try this:

acf_add_local_field_group([
    // ...
    'show_in_rest' => true,
]);

from wordplate.

steve-ref avatar steve-ref commented on June 2, 2024

@fiskhandlarn

i think they work just fine together. :)

Oh well yeah, It's me who doesn't understand how it works ^^, this is not a package problem, didn't want to offense.

Indeed, you're right, it's an outdated version of ExtendedACF but the imports are from Wordplate so I thought it was related to Wordplate itself.

My other question was:

I usually put functions in functions.php because that's what I've always been told. Where could I put this function without that file and without breaking the current code?

Thanks for your help

from wordplate.

fiskhandlarn avatar fiskhandlarn commented on June 2, 2024

I usually put functions in functions.php because that's what I've always been told. Where could I put this function without that file and without breaking the current code?

anywhere you like, as long as you include/require it from functions.php. if you don't have a functions.php file present in your theme i suggest you create it. if you can't create it, i can't think of another way besides creating a plugin.

from wordplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.