Ability to set character limit in BuddyPress?
Simple solution is to add a maxlength attribute to the textarea field. For example <textarea maxlength=”140″> </textarea>
Simple solution is to add a maxlength attribute to the textarea field. For example <textarea maxlength=”140″> </textarea>
You could pull all of the comments by current user and loop over them to see how may where today or you can create a custom sql Query to select just the count of comments for the last 24 hours, something like this: global $wpdb,$current_user; $sql = $wpdb->prepare(” SELECT count(*) FROM wp_comments WHERE comment_author=”%s” AND … Read more
As @StephenHarris pointed out there’s also the pre_get_posts filter. function hwl_home_pagesize( $query ) { if ( is_category( 9 ) ) { // If you want “posts per page” $query->query_vars[‘posts_per_page’] = 1; return; } if ( is_category( ‘movie’ ) ) { // If you want “showposts” $query->query_vars[‘showposts’] = 50; return; } } add_action( ‘pre_get_posts’, ‘hwl_home_pagesize’, 1 … Read more
To get a specific length you can use: wp_trim_words function. It has 3 parameters. Text to trim. Ex: get_the_content() Number of words. Ex: 295 What to append after end of the text. Ex: ” This means null. Use this: <span> <?php echo wp_trim_words( get_the_content(), 295, ” ); ?> <i><a style=”color:#1975D1;float:Right;” class=”title” href=”https://wordpress.stackexchange.com/questions/75069/<?php the_permalink() ?>” rel=”bookmark”>Click … Read more
That number is taken from wp_max_upload_size(), and there is a filter: ‘upload_size_limit’. See wp-admin/includes/template.php. So this should work (not tested): add_filter( ‘upload_size_limit’, ‘wpse_70754_change_upload_size’ ); function wpse_70754_change_upload_size() { return 1000 * 1024; }
You can filter ‘wpmu_validate_user_signup’ and check if the error code matches the 4 character warning. Then just unset the error code. Sample plugin: <?php # -*- coding: utf-8 -*- /* Plugin Name: Allow short user names for multi site. */ add_filter( ‘wpmu_validate_user_signup’, ‘wpse_59760_short_user_names’ ); /** * Allow very short user names. * * @wp-hook wpmu_validate_user_signup … Read more
You’re looking in the wrong place. When a user first attempts to register, their username and email is processed and sanitized inside the register_new_user() function in wp-login.php. This is where you want to do your filtering. Before the user is created, WordPress will pass the sanitized user login, email address, and an array or errors … Read more
The codex is your friend and should be your first stop 🙂 The […] is added by the_excerpt(). There is a filter supplied called the excerpt_more filter that is specifically included to customize the read more text after the excerpt To remove the […] after the excerpt text, you can do the following function new_excerpt_more( … Read more
Actually it happens when the number of processes exceeds the limits set by the hosting provider. To avoid either we need to enhance the capacity by hosting providers or we need to check in the code whether any process takes longer time (like background tasks).
When dealing with null, = does not match the null values. You can use IS NULL or IS NOT NULL LIMIT can be used with UPDATE but with the row count only