Limit the_excerpt in the first point (.) of the sentence

First, please make sure you understand the difference between the_excerpt and the_content. You are asking about the_excerpt but I suspect that you might actually mean the_content. That said… You can filter the the_excerpt function with a filter of the same name. add_filter( ‘the_excerpt’, function ($excerpt) { return substr($excerpt,0,strpos($excerpt,’.’)+1); } );

Limit number of pages that use a specific template?

You can approach this by first using a database query to count the number of pages that are already using the template: $query = “SELECT COUNT(*) as total FROM prefix_posts as p JOIN prefix_postmeta as m ON p.ID = m.post_id WHERE p.’post_type’ = ‘page’ AND p.’post_status’ = ‘publish’ AND m.’meta_key’ = ‘_wp_page_template’ AND m.’meta_value’ = … Read more

WordPress User Name Limitations

I think the answer is in the source. $username = wp_strip_all_tags( $username ); $username = remove_accents( $username ); // Kill octets $username = preg_replace( ‘|%([a-fA-F0-9][a-fA-F0-9])|’, ”, $username ); $username = preg_replace( ‘/&.+?;/’, ”, $username ); // Kill entities // If strict, reduce to ASCII for max portability. if ( $strict ) $username = preg_replace( ‘|[^a-z0-9 … Read more

Is there a limit on the size of a WP page?

Some of your user pictures are 30K characters long when encoded. Have you heard of URL length limit? See What is the maximum length of a URL?. Also I believe there are some limits were put by browser manufacturers in spite of HTML 4-5 specifications does not put any limits on attribute value length (AFAIK).

How to limit user to publish post per day and per role?

You can use my plugin Posts Creation Limits which has a per user, per role, per post type, per post status limiting system and combined with its post_creation_limits_custom_checks action hook and check if the user has created a post that day already – if so: show the the “limit reached message”. For example: add_action( ‘post_creation_limits_custom_checks’, … Read more

Set a maximum upload count for users on a specific user role

I’m not really sure which is the real problem with code you posted, however I cant understand why use 2 functions when one is enough… add_filter( ‘wp_handle_upload_prefilter’, ‘limit_uploads_for_user_roles’ ); function limit_uploads_for_user_roles( $file ) { $user = wp_get_current_user(); // add the role you want to limit in the array $limit_roles = array(‘contributor’); $filtered = apply_filters( ‘limit_uploads_for_roles’, … Read more

Limiting the number of users

As you can see in the WordPress Option Reference, there’s an option called users_can_register. You can – per default – set it in your (network-)sites settings. 1 => Yes 0 => No As usual: There’s a filter to intercept that from a plugin. “option_{$option_name}” So you can simply attach a callback to this filter and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)