Comments (5)
An example with this.props.attrs would be awesome.
I'm not sure what you mean? 3P Modules do not have access to this.props.attrs
because its contents is hoisted up into this.props
.
How are you using the WP object with JSX?
Could you provide more details? What is it exactly you are wondering how to accomplish?
How are you using the WP object with JSX?
Yes and no. We do use them but not consistently. We've found that they don't make much of an impact on our development workflow. More often than not they are a chore.
from create-divi-extension.
In several places in bundle.js there is
this.props.attrs.module_class
this.props.attrs.text_orientation
this.props.attrs.module_id
this.props.attrs.admin_label
this.props.attrs.title
this.props.attrs.content
so I'm wondering how you assign attrs to this.props
from create-divi-extension.
I see. Well, as I explained above, that is not exposed to 3rd party modules. All the attrs are available to you under this.props
.
from create-divi-extension.
So how are you getting the page title or permalink from a page_id in JSX?
Like the equivalent of get_the_title($page_id), get_permalink($page_id) ?
from create-divi-extension.
We send that data down when the builder loads using wp_localize_script(). We're planning to expose that data via the API as part of addressing #23
from create-divi-extension.
Related Issues (20)
- Custom fields styles no loading on Editor HOT 3
- Support for the experimental syntax 'dynamicImport' isn't currently enabled
- node-sass HOT 1
- Problem DIVI causing HTTP 500 on WooCommerce API
- Trying to get the version of the divi builder via PHP.
- How to link the field in the theme builder with the field from my custom post type
- Make upload field return image ID instead of URL
- Custom Taxonomies for Shop module
- Not able to create Divi Extensions HOT 10
- Multi-site issues with updating Divi extensions
- How to add a javascript onclick event to an element in a custom module HOT 1
- add_rewrite_rule breaks Theme/Visual Builder
- Access to @Divi/components or similar repository/package HOT 6
- displaying custom detail page while using divi templates
- DIVI Builder not workding | [React-imported-component] TypeError: n(...) is not a function
- Disable Divi Premade Layout
- et_pb_contact_form_submit not fired when JavaScript is enabled HOT 1
- How to get page specific content in rest api
- et-cache directory overpopulating
- Programmatically add divi module via php script
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-divi-extension.