fixing problem whit return when no relatedPostId
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
29bfa6e9f0
commit
ebcc7a6f08
File diff suppressed because one or more lines are too long
13
blocks/questions-container/build/render.php
Normal file
13
blocks/questions-container/build/render.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
$relatedPostId = isset($attributes['relatedPostId']) ? $attributes['relatedPostId'] : null;
|
||||
if (!$relatedPostId) return;
|
||||
|
||||
$relatedPost = get_post($relatedPostId);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<section id="questions-container-<?php echo $relatedPostId ?>" class="questions-container-block">
|
||||
<h2 class="questions-container-block__title"><?php echo $relatedPost->post_title ?></h2>
|
||||
<?php echo do_blocks($relatedPost->post_content) ?>
|
||||
</section>
|
||||
14
blocks/questions-container/build/style-index.css
Normal file
14
blocks/questions-container/build/style-index.css
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/*!***************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
|
||||
\***************************************************************************************************************************************************************************************************************************************************/
|
||||
/**
|
||||
* The following styles get applied both on the front of your site
|
||||
* and in the editor.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
.wp-block-homegrade-content-blocks-questions-container h2 {
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=style-index.css.map*/
|
||||
1
blocks/questions-container/build/style-index.css.map
Normal file
1
blocks/questions-container/build/style-index.css.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"./style-index.css","mappings":";;;AAAA;;;;;EAAA;AAQC;EACC;AADF,C","sources":["webpack://multiblocks/./src/style.scss"],"sourcesContent":["/**\n * The following styles get applied both on the front of your site\n * and in the editor.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wp-block-homegrade-content-blocks-questions-container {\n\th2 {\n\t\tfont-weight: 800;\n\t}\n}\n"],"names":[],"sourceRoot":""}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
$relatedPostId = $attributes['relatedPostId'] ?? null;
|
||||
$relatedPostId = isset($attributes['relatedPostId']) ? $attributes['relatedPostId'] : null;
|
||||
if (!$relatedPostId) return;
|
||||
|
||||
$relatedPost = get_post($relatedPostId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user