function cwpai_parse_and_add_attributes( $atts ) { $atts = shortcode_atts( array( ‘entry_id’ => 0, ), $atts, ‘cwpai_parse_words’ ); if (empty($atts[‘entry_id’])) { return ”; } $entry = FrmEntry::getOne($atts[‘entry_id’]); if (!$entry) { return ”; } $user_input = $entry->metas[‘user_input’]; $user_input = strip_tags($user_input); $words = array_map(‘trim’,…Continue reading
function replace_multiple_texts_on_the_fly($content) { // Array of text pairs to find and replace $text_pairs = array( ‘wp_code_guarantee_days’ => ’60’, ‘wp_code_dagen_garantie’ => ’60’, // Add more pairs as needed ); foreach ($text_pairs as $old_text => $new_text) { // Use str_replace for simple…Continue reading
add_filter( ‘http_request_args’, function( $args, $url ) { if ( strpos( $url, ‘snippet/save’ ) !== false ) { $args[‘timeout’] = 15; } return $args; }, 10, 2 );Continue reading
class GPEP_Edit_Entry { private $form_id; private $delete_partial; private $passed_through_entries; private $refresh_token; private $process_feeds; public function __construct( $options ) { if ( ! function_exists( ‘rgar’ ) ) { return; } $this->form_id = rgar( $options, ‘form_id’ ); $this->delete_partial = rgar( $options, ‘delete_partial’,…Continue reading
function custom_generateblocks_query_loop_args( $query_args, $attributes ) { // Check if the query is for the specific block where you want to apply the custom order if ( ! empty( $attributes[‘query’] ) && isset( $attributes[‘query’][‘postIds’] ) ) { // Ensure the post…Continue reading
/* Change the email summary email address * * Original doc: https://wpmailsmtp.com/docs/changing-the-email-summary-email-address/ */ add_filter( ‘wp_mail_smtp_reports_emails_summary_send_to’, function ( $email ) { return ‘[email protected]’; } );Continue reading
/** * Ensures the canonical URL ends with a slash. * * This function checks if the provided canonical URL ends with a slash (‘/’). If not, it appends one. * * @param string $canonical The current page’s generated canonical…Continue reading
function wpf_dev_modern_dropdown_search_results( $config, $forms ) { $config[‘shouldSort’] = true; $config[‘shouldSortItems’] = false; $config[‘sortBy’] = ‘label’; // Sort by label to achieve alphabetical sorting return $config; } add_filter( ‘wpforms_field_select_choicesjs_config’, ‘wpf_dev_modern_dropdown_search_results’, 10, 2 );Continue reading