Skip to content

Commit

Permalink
deprecated functions update 1
Browse files Browse the repository at this point in the history
  • Loading branch information
kasprzyk-sz committed Aug 1, 2023
1 parent 33cbdd3 commit d3dfe9f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
10 changes: 6 additions & 4 deletions wp-content/plugins/vf-gutenberg/vf-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ function add_compatible($keys, callable $callback) {
* Render VF Nunjuck template blocks
*/
public function render_block_nunjucks($html, $block) {
if (preg_match('/^vf\//', $block['blockName'])) {
if (isset($block['attrs']['render'])) {
return $block['attrs']['render'];
if (!empty($block['blockName'])) {
if (preg_match('/^vf\//', $block['blockName'])) {
if (isset($block['attrs']['render'])) {
return $block['attrs']['render'];
}
}
}
return $html;
return $html;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions wp-content/plugins/vf-members-block/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@

$leader = boolval($leader);

if (!empty($keyword)) {
$keyword = trim($keyword);
}

// Hide selected fields
$hide_fields = get_field('hide_fields');
Expand Down
2 changes: 2 additions & 0 deletions wp-content/plugins/vf-wp/vf-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ function vf_log($log) {
* Return true if a string is empty (including empty HTML)
*/
function vf_html_empty($str) {
if (!empty($str)) {
return preg_match('#\S#', strip_tags($str)) !== 1;
}
}

/**
Expand Down
6 changes: 6 additions & 0 deletions wp-content/themes/vf-wp-groups/vf-wp-groups-header/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ public function get_hero_heading() {
'vf_hero_heading',
$this->post()->ID
);
if (!empty($heading)) {
$heading = trim($heading);
}
if (empty($heading)) {
$heading = get_bloginfo('name');
}
Expand Down Expand Up @@ -165,7 +167,9 @@ public function filter_hero_heading($heading) {
*/
public function get_hero_text() {
$text = get_field('vf_hero_subheading', false, false, $this->post()->ID);
if (!empty($text)) {
$text = trim($text);
}
// If text is empty use the Content Hub description
if (vf_html_empty($text) && class_exists('VF_Cache')) {
// Get the global taxonomy term
Expand Down Expand Up @@ -199,10 +203,12 @@ public function filter_hero_text_cleanup($text) {
return $text;
}
// Cleanup Content Hub response
if (!empty($text)) {
$text = preg_replace(
'#<[^>]*?embl-conditional-edit[^>]*?>.*?</[^>]*?>#',
'', $text
);
}
// Filter allowed tags
$text = wp_kses($text, array(
'a' => array(
Expand Down

0 comments on commit d3dfe9f

Please sign in to comment.