Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@7472ed2 from refs/heads/release/5.0-q…
Browse files Browse the repository at this point in the history
…uiz-shared
  • Loading branch information
prcdevgitbot committed Mar 20, 2024
1 parent 6dc73bb commit b6cfd8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
6 changes: 3 additions & 3 deletions blocks/logo/src/edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ function LogoInner({ onLoad, className, width }) {
const svgLoad = (svg) => {
const svgEl = svg();

const [w, h] = svgEl.props.viewBox.split(' ').slice(2);
const [width, height] = svgEl.props.viewBox.split(' ').slice(2);

console.log('svgEl', svgEl, svgEl.props.viewBox, w, h);
console.log('svgEl', svgEl, svgEl.props.viewBox, width, height);

onLoad(w, h);
onLoad(width, height);
};

switch (selectedStyle[1]) {
Expand Down
12 changes: 2 additions & 10 deletions blocks/post-taxonomy-terms/post-taxonomy-terms.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,8 @@ public function render_block_callback( $attributes, $content, $block ) {
)),
'style' => array_key_exists('separator', $attributes) ? '--separator: "' . $attributes['separator'] . '"' : null,
));
$post_id = get_the_ID();
$parent_id = wp_get_post_parent_id($post_id);
$post_terms = wp_get_post_terms( $post_id, $taxonomy, array( 'number' => $per_page ) );
// If this is a category taxonomy block we need to check if the only term being returned is "uncategorized" and if so, we need to return an empty array so that the block will look for the parent post's terms, if available.
if ( 'category' === $taxonomy && 1 === count($post_terms) && 'uncategorized' === $post_terms[0]->slug ) {
$post_terms = array();
}
if ( 0 !== $parent_id && empty($post_terms) ) {
$post_terms = wp_get_post_terms( $parent_id, $taxonomy, array( 'number' => $per_page ) );
}

$post_terms = wp_get_post_terms( get_the_ID(), $taxonomy, array( 'number' => $per_page ) );
$markup = '';
if ( !empty($post_terms) && !is_wp_error($post_terms) ) {
$markup .= '<ul class="wp-block-prc-block-post-taxonomy-terms__list">';
Expand Down

0 comments on commit b6cfd8f

Please sign in to comment.