Download Monitor: Index PDF content for parent page

Relevanssi can handle Download Monitor files without significant problems. If you want to use the “Index PDF contents for the parent page” option, there’s a problem, though. Download Monitor comes in between: the PDF post is attached to the Download Monitor dlm_download post and not the page where the [download]……grab that. $download_id = preg_replace( ‘/[^\d]/’, ”, $meta_field_value ); if ( $download_id ) { // Replace the original post_parent ID with the new one. $query = preg_replace( ‘/post_parent = \d+/’, “post_parent = $download_id”, $query ); } } return $query; } If the [download] shortcode is somewhere in the post content,……string The modified MySQL query. */ function rlv_download_monitor( $query, $post_id ) { $post_object = relevanssi_get_post( $post_id ); $id_matches = preg_match_all( ‘/\[download id=.(\d+).\]/ims’, $post_object->post_content, $matches ); if ( $id_matches ) { $download_id = implode( ‘,’, $matches[1] ); $query = preg_replace( ‘/post_parent = \d+/’, “post_parent IN ($download_id)”, $query ); } return $query;…

WP Download Manager

…be different, in which case the function above needs to be changed to this: $filename = $upload_dir[‘basedir’] . ‘/download-manager-files/’ . array_values( $files )[0]; Limitations With these two small functions, Relevanssi can read the files attached to WP Download Manager posts. There’s one major limitation: WP Download Manager posts can contain…WP Download Manager is a popular file management plugin for WordPress. It’s unfortunately incompatible with Relevanssi attachment content reading out of the box, as Relevanssi expects the attachments to be stored in the Media Library, and WP Download Manager stores the files outside Media Library. Fortunately, Relevanssi includes the necessary……add_filter( ‘relevanssi_get_attached_file’, ‘rlv_wpdmpro_file’, 10, 2 ); function rlv_wpdmpro_file( $filename, $post_id ) { $files = get_package_data( $post_id, ‘files’ ); $upload_dir = wp_get_upload_dir(); $filename = $upload_dir[‘basedir’] . ‘/download-manager-files/’ . $files[0]; return $filename; } This function fetches the files attached to the WP Download Manager post with get_package_data(). To get the path, this…

MemberPress Downloads add-on

The Downloads add-on for MemberPress adds downloadable files to MemberPress. These files are stored outside the Media Library, so by default Relevanssi attachment indexing has no access to them. However, Relevanssi offers filter hooks you can use to make Relevanssi index the MemberPress Downloads files. Adjust the query First, we……need to tell Relevanssi to look for mpdl-file posts instead of attachment posts using the relevanssi_get_attachment_posts_query filter hook. By default, Relevanssi looks for posts with the post type attachment, post status inherit and a suitable MIME type. These all need to be changed, because the Downloads posts have the post……to modify the name and path of the file sent to Relevanssi: add_filter( ‘relevanssi_get_attached_file’, ‘rlv_mpdl_file’, 10, 2 ); /** * Filters the name and path of the file. * * Gets the file name from the _mpdl_file_filename custom field of the download file * post and corrects the path, too….

Download

The link to download the latest version of Relevanssi Premium appears below if you have an active subscription. If you don’t have one, register for an account here and follow the instructions. If you’re looking for the free version of Relevanssi, check the WordPress plugin repository….

Premium 2.19 / Free 4.17

…Minor fix: If the sentence query variable is used to enable phrase searching, Relevanssi now adds quotes to the highlight parameter. Minor fix: Add support for TablePress table_filter shortcodes. Minor fix: Improve WP File Download file content indexing support. Relevanssi indexing now happens after the WPFD indexing is done. Premium….

relevanssi_disabled_shortcodes

…’woocommerce_edit_address’, ‘tc_process_payment’, ‘maxmegamenu’, // Max Mega Menu. ‘searchandfilter’, // Search and Filter. ‘downloads’, // Easy Digital Downloads. ‘download_history’, ‘purchase_history’, ‘download_checkout’, ‘purchase_link’, ‘download_cart’, ‘edd_profile_editor’, ‘edd_login’, ‘edd_register’, ‘swpm_protected’, // Simple Membership Partially Protected content. ‘gravityform’, // Gravity Forms. ‘sdm_latest_downloads’, // SDM Simple Download Monitor. ‘slimstat’, // Slimstat Analytics. ‘ninja_tables’, // Ninja Tables….

Premium 1.15.4 / Free 3.5.12

…Fake posts created for taxonomy terms now include the parent in $post->post_parent. Doing a quick edit cleaned out the Relevanssi post controls settings. The free version can be downloaded from the plugin repository. The Premium version can be downloaded from the downloads page and with the WordPress plugin auto-update feature….

Premium 1.14.6 | Free 3.5.6

…Relevanssi didn’t highlight terms that were followed by a ?, ! or an apostrophe. There’s also a new filter hook relevanssi_ok_to_log that makes it easier to control query logging. The free version can be downloaded from the repository, Premium can be downloaded through automatic updates or from the download page….

Premium 1.16.2 / Free 3.6.2

…doesn’t try to highlight post titles. New action: relevanssi_update_options lets you adjust Relevanssi options immediately after the defaults are set. Remove notices about duplicated database columns when installing the plugin. New versions can be updated automatically from the WordPress dashboard. You can also download Relevanssi Premium from the downloads page….…update includes: Premium only: ACF repeater fields with dashes didn’t work; that is now fixed. Simple Membership plugin is now supported automatically to restrict access to posts. Relevanssi can now handle orderby parameter in array format. Relevanssi now blocks Easy Digital Downloads shortcodes when indexing to improve compatibility with EDD….

ACF: Indexing File field title

…the trick: add_filter( ‘relevanssi_custom_field_value’, ‘rlv_file_name’, 10, 2 ); function rlv_file_name( $values, $field ) { if ( ‘download_section’ === $field ) { $values = array_map( function( $attachment_id ) { return get_the_title( $attachment_id ); }, $values ); } return $values; } Assuming the field name is download_section, this indexes the attachment title….I use the ACF field type File for a download section, but the displayed file title is not indexing. The format I return the ACF field data is “File Array (array)”. For Relevanssi, it doesn’t matter which ACF return format you choose. Relevanssi doesn’t use get_field() but instead uses the…