Avoid too long words in a post title, post content or comment but only if its not a url

Thank you Milo, “word-break” alone wasn’t enough as it’s css3 only and not cross-browser. But I found this: .bloc_content{ overflow:hidden; -ms-word-break: break-all; word-break: break-all; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; } It seems to to work in all cases I tested. Hopefully it would be cross-browser enough to solve the problem. Not sure … Read more

How to give members access to their own protected page?

funtion add_profile_page(){ $title_of_page = “page name”; if( null == get_page_by_title( $title_of_page ) ) { $post_id = wp_insert_post( array( ‘comment_status’ => ‘closed’, ‘ping_status’ => ‘closed’, ‘post_author’ => ‘1’, ‘post_name’ => ‘namehere’, ‘post_title’ => $title_of_page, ‘post_status’ => ‘publish’, ‘post_type’ => ‘page’ ) ); update_post_meta($post_id, ‘_wp_page_template’, ‘mycustomprofile’); } } add_filter( ‘after_setup_theme’, ‘add_profile_page’ ); your template page /* Template … Read more

WordPress Shop and restricting products and categories for some users/groups

Essentially, you need: A global role-category relationship list, and/or… A per-user category list For per-user categories, hook onto the relevant profile actions: show_user_profile & edit_user_profile for displaying the field (use wp_terms_checklist()) personal_options_update & edit_user_profile_update for saving the data For the role-category data, use an options page. Loop over all roles ($wp_roles->roles) with a term checklist … Read more