Custom URL Structure for posts with subcategories
Custom URL Structure for posts with subcategories
Custom URL Structure for posts with subcategories
I have found an url which explains it all, just adding some javascript, php and css to TinyMCE by some hooks and you got it up and running. http://codex.wordpress.org/Plugin_API/Filter_Reference/mce_external_plugins
Theming Custom Plugin Page
XSS generally would only occur through AJAX or form handling. Verify a referrer header is actually from your FQDN and/or require a captcha, providing pseudorandom input validation.
I believe you’re using ajax refering the process_form.php. However the right way to access any ajax is through the wp-admin/admin-ajax.php. Pull all your code from process_form.php to a function (can be added on your main plugin file): function my_process_form() { //…code from process_form.php if ( ! $error ) { //your error boolean return wp_json_success(); //recommend … Read more
If I am reading your code and description correctly, you can simplify that to: $taxonomy = ‘delivery_option’; $do = get_the_terms($post->ID,$taxonomy); if (!empty($do) && !is_wp_error($do)) { $do = array_shift($do); // assuming a single value as per the description. $term = str_replace(‘-delivery’,”,$do->slug); get_template_part(‘includes/sidebar-part’,$term); } else { echo ‘<p>No custom include!</p>’; } Note, I used WordPress’s get_template_part() instead … Read more
There is a build in meta box to handle custom excerpts. You just need to check the excerpt option box under screen options in your post screen, once checked, you will see the excerpt editor box below your WYSIWYG editor metabox. For custom post types, make sure that you set the excerpt as support feature … Read more
I use this on my instals to get rid of p tags around images: /* * * Remove annoying <p> tags on images, messes with my shizzle * */ function my_filter_ptags_on_images($content) { return preg_replace(‘/<p>(\s*)(<img .* \/>)(\s*)<\/p>/iU’, ‘\2’, $content); } add_filter(‘the_content’, ‘my_filter_ptags_on_images’);
You’re correct in your approach. If you post your code will be better, but something like this: $args = array( ‘post_type’ => ‘project’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘region’, ‘field’ => ‘slug’, ‘terms’ => $region, //set your region ), ), ); $the_query = new WP_Query( $args ); // The Loop of Projects by Region … Read more
A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control