What is user_trailingslashit() for?

The trailingslashit() function adds a / to the end of a URL if it lacks one. user_trailingslashit() uses the permalink template as set under Settings > Permalinks to decide whether to add or remove the trailing slash from the end of the URL For example, if you had the permalink format set to /%year%/%monthnum%/%day%/%postname%/ (note … Read more

changing function wp_register

Use the following filter named register: add_filter( ‘register’, ‘wpse_96892_register_link’ ); function wpse_96892_register_link( $link ) { if ( is_user_logged_in() ) return $link; return str_replace( // search array ( site_url(‘wp-login.php?action=register’, ‘login’), __(‘Register’) ), // replacements array ( site_url(‘/profile’), __(‘Profile Page’) ), $link ); }

Trouble using antispambot()

I think the problem is echo vs return, i.e. that you are using the_field instead of get_field. What you’re trying to do is similar to this: antispambot( echo( ‘[email protected]’ ) ) but echo returns nothing. Please try: <?php $email = antispambot( get_field( ‘queries_e-mail’ ) ); ?> <p> <a href=”https://wordpress.stackexchange.com/questions/124180/mailto:<?php echo $email; ?>”> <?php echo $email; … Read more

Custom image size in Media Dropdown

The above problem got fixed after regenerating the thumbnails and by using the following function. function mytheme_image_size_names( $sizes ) { $sizes[‘blog_body_img’] = __( ‘Blog Body Image’, ‘isaumya’ ); return $sizes; } add_filter( ‘image_size_names_choose’, ‘mytheme_image_size_names’, 11, 1 );

Automatically insert php function into post $the_content

I’m sure you want to use the_content filter instead of the default_content filter (already mentioned by @jgraup) because what happens if the generated HTML changes? Then you’re stuck with it in your content. It’s better to add it dynamically. Here’s one suggestion: add_filter( ‘the_content’, function( $content) { if( ! in_the_loop() ) return $content; if( ‘property’ … Read more