Есть ли способ удалить wp-block-brad-border-box из пользовательского блока WordPress? - PullRequest
0 голосов
/ 07 февраля 2020

Я сделал свой первый в мире блок Гутенберга, и у меня возникла одна проблема с ним. это идет с div, названным wp-block-brad-border-box, и это разрушает мою цель блока. Так что мой вопрос, есть ли способ удалить его только в мой блок? если да, то как мне это сделать?

Мои коды: плагин. php: function loadMyBlock() { wp_enqueue_script( 'my-new-block', plugin_dir_url(__FILE__) . 'block.js', array('wp-blocks','wp-editor'), true ); } add_action('enqueue_block_editor_assets', 'loadMyBlock');

Блок. js: wp.blocks.registerBlockType('brad/border-box', { title: 'Personalijuhtimis card', icon: 'welcome-write-blog', category: 'common', attributes: { contents: {type: 'string'}, link: {type: 'string'}, text: {type: 'string'} }, edit: function(props) { function updateContent(event) { props.setAttributes({contents: event.target.value}) } function updateicon(event) { props.setAttributes({link: event.target.value}) } function updatetext(event) { props.setAttributes({text: event.target.value}) } return React.createElement( "div", null, React.createElement( "h3", null, "Personalijuhtimis card" ), React.createElement("input", { type: "text", placeholder:"Pealkiri", value: props.attributes.contents, onChange: updateContent }), React.createElement("input", { type: "text", placeholder:"ikooni link", value: props.attributes.link, onChange: updateicon }), React.createElement("input", { type: "text", placeholder:"tekst", value: props.attributes.text, onChange: updatetext }) ); }, save: function(props) { return wp.element.createElement( "div", { }, wp.element.createElement( "div", { className: "col-lg-4 col-md-6 col-sm-6" }, wp.element.createElement( "div", { className: "media services-info" }, wp.element.createElement( "i", { className: props.attributes.link }, ), wp.element.createElement( "div", { className: "media-body" }, wp.element.createElement( "h5", { }, props.attributes.contents ), wp.element.createElement( "p", { }, props.attributes.text ), ), ), ), ) } })

html : <div class="wp-block-brad-border-box"> <div class="col-lg-4 col-md-6 col-sm-6"> <div class="media services-info"> <i class="far fa-envelope" aria-hidden="true"></i> <div class="media-body"> <h5>Talentide juhtimiine</h5> <p>Edu aluseks on enamasti õigete inimeste olemasolu õigel hetkel õigel ametikohal tehes õigeid asju</p> </div> </div> </div> </div>

Или есть способ удалить элемент wp-block-brad-border-box с помощью jquery?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...