This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var thing = 'Thing'; | |
var itemId = thing.substring(1, thing.length); | |
// Output would be "hing". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo esc_html( sprintf( 'Text here %s', $variable ), 'standardchartered' ) ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Make the image a link | |
if ( 'yes' === $settings->cb_blk_one_show_btns ) : | |
// Run a foreach loop over every button from global options | |
if ( count( $settings->cb_blk_one_btns ) === 1 ) : | |
foreach ( $settings->cb_blk_one_btns as $key => $val ) : | |
printf( '<a href="%1$s" class="ctawrapa %2$s" target="%3$s" %4$s>', | |
( strpos( $settings->cb_blk_one_btns[ $key ]->sc_global_urltype, 'open-country-popup' ) !== false ) ? esc_attr( '#country-popup' ) : esc_url( $settings->cb_blk_one_btns[ $key ]->sc_global_btnurl ), // %1$s : href | |
( ( strpos( $settings->cb_blk_one_btns[ $key ]->sc_global_urltype, 'open-country-popup' ) !== false ) ? esc_attr( 'country-popup' ) : '' ), // %2$s : Add country-popup class for JS listener | |
( ( strpos( $settings->cb_blk_one_btns[ $key ]->sc_global_urltype, 'open-country-popup' ) === false ) ? esc_url( $settings->cb_blk_one_btns[ $key ]->sc_global_urltype ) : '' ), // %3$s : If not country popup as target (_self, _blank) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Echo a specific thing | |
<?php echo '<script>console.log("Your stuff here")</script>'; ?> | |
// Echo a dynamic element | |
<?php echo '<script>console.log( ' . get_page_template() . ' )</script>'; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The 'Round' syntax | |
=MROUND( A1 ; 0.25 ) | |
// ROUND a SUM | |
=MROUND( sum( ( hour( E141 )*60+MINUTE( E141 ) ) )/60 ; 0.25 ) | |
// Another way | |
=CEILING( sum( ( hour( E175 )*60+MINUTE( E175 ) ) )/60 , 0.25 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=sum((hour(C3)*60+MINUTE(C3)))/60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onEdit(e) { | |
if (!e.value) return; | |
e.source.getActiveSheet() | |
.getRange('K1') | |
.setValue(new Date()); | |
} | |
Date format: dd/MM/yyyy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php the_title_attribute(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( '.accordion-effect' ).click( function () { | |
$( this ).attr( 'aria-expanded', 'true' ); | |
if ( $( '.accordion-effect' ).attr( 'true' ) ) { | |
$( this ).attr( 'aria-expanded', 'false' ); | |
} | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mostloop = new WP_Query( | |
[ | |
'post_type' => 'post', | |
'post__in' => explode( ',', $settings->ins_mv_suggest ), | |
'posts_per_page' => 12, | |
'date_query' => [ | |
'column' => 'post_date_gmt', | |
'after' => '3 months ago', | |
'inclusive' => true, |