interconnectit

interconnectit supports this item

Supported

Popular questions for this item

Does the plugin support Woocommerce products post type?

Yes! However if you wish to make Woocommerce fields required you’ll have to use the plugin’s API which is documented in the readme.md

Does the plugin work with the Posts 2 Posts plugin to make connections required?

Yes, using the plugin API you can add the following to your theme’s functions.php where you register your posts type connections:

register_required_field(
    'p2p_connections',
    'Connections are required before publishing', 
    false, 
    array( 'post' ), 
    '#p2p-from-posts_to_pages' 
);

Does this plugin allow you to enforce the length of titles and post content?

Yes it does! Just add the following code to your functions.php in your theme and change the numbers to match your needs.

if ( function_exists( 'register_required_field' ) ) {

function check_title_length( $value, $postarr ) {
   return strlen( $value ) >= 20;
}

function check_content_length( $value, $postarr ) {
   return strlen( strip_tags( $value ) ) >= 200;
}

register_required_field( 'post_title', 'The title must be at least 20 characters long', 'check_title_length', array( 'post' ), '#titlediv' );

register_required_field( 'post_content', 'Your content must be at least 200 characters long', 'check_content_length', array( 'post' ), '#postdivrich' );

}

You can create custom validation rules for almost any post fields or post meta fields. If you need help with a specific case just ask in the comments.

How do I make custom taxonomies required?

The following code can be placed in your functions.php, making sure to replace ‘custom-taxonomy-name’ with your taxonomy name.

Note the difference for hierarchical and non hierarchical taxonomies:

// for hierarchical taxonomies
register_required_field( 'custom_taxonomy', 'You must add some terms for taxonomy X', function( $value, $postarr ) {
    $tags = array_filter( $postarr[ 'tax_input' ][ 'custom_taxonomy_name' ] );
    return count( $tags );
} );

// for non hierarchical taxonomies
register_required_field( 'custom_taxonomy', 'You must add some terms for taxonomy X', function( $value, $postarr ) {
    $tags = array_filter( explode( ',', $postarr[ 'tax_input' ][ 'custom_taxonomy_name' ] ) );
    return count( $tags );
} );

Show more

Contact the author

This author provides limited support for this item through this item's comments.

Additional information from interconnectit:

Support for my items includes:
  • Responding to questions or problems regarding the item and its features
  • Fixing bugs and reported issues
  • Providing updates to ensure compatibility with new software versions
Item support does not include:
  • Customization and installation services
  • Support for third party software and plug-ins
by
by
by
by
by
by