Skip to content

Instantly share code, notes, and snippets.

@webdevs-pro
Created January 22, 2022 19:17
Show Gist options
  • Save webdevs-pro/d6ae16e36def45274bf5c5c5ff9b5201 to your computer and use it in GitHub Desktop.
Save webdevs-pro/d6ae16e36def45274bf5c5c5ff9b5201 to your computer and use it in GitHub Desktop.
<?php
$data = @json_decode( get_post_meta( 21361, '_elementor_data', true ), true );
if ( $data ) {
function stylepress_email_find( $data, $findkey ) {
if ( is_array( $data ) ) {
foreach ( $data as $d ) {
if ( $d && ! empty( $d['id'] ) && $d['id'] === $findkey ) {
return $d;
}
if ( $d && ! empty( $d['elements'] ) && is_array( $d['elements'] ) ) {
$value = stylepress_email_find( $d['elements'], $findkey );
if ( $value ) {
return $value;
}
}
}
}
return false;
}
$element = stylepress_email_find( $data, 'd5f6a05' );
error_log( "element\n" . print_r( $element, true ) . "\n" );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment