1. Home
  2. Knowledge Base
  3. Document Library Pro
  4. Developer Documentation

Actions and Filters

There are a number of filters and actions provided in Document Library Pro which allow you to customize the behavior of the plugin.

Please note that these code snippets are aimed at developers. If you feel comfortable using them, our article on how to use code snippets can serve as a helpful guide. If you don't know how to use this code then you can get a quote from our plugin customization service to do the work for you.

Document Library Pro 4.0 supports both the current DataViews frontend and the legacy DataTables frontend. Hooks identified as DataViews-only or legacy-only run only on that path. Class names in callback arguments may be dependency-scoped in the installed plugin; unless you need a type declaration, it is safest to leave callback parameters untyped.

Language and text

There are various filters for manipulating text strings and messages used in the plugin. Please also refer to the article about how to override Document Library Pro text strings.

document_library_pro_language_defaults

Filters the complete array of frontend language strings.

Arguments

  • $strings (array): The strings value supplied to this hook.

Return

array: The filtered $strings value.

add_filter( 'document_library_pro_language_defaults', function( $strings ) {
    $strings['zeroRecords'] = 'No matching documents.';
    return $strings;
} );

document_library_pro_dataviews_i18n

Filters all translations passed to the DataViews frontend. This filter is DataViews-only.

Arguments

  • $strings (array): The strings value supplied to this hook.

Return

array: The filtered $strings value.

add_filter( 'document_library_pro_dataviews_i18n', function( $strings ) {
    $strings['searchTableData'] = 'Search documents';
    return $strings;
} );

document_library_pro_search_label

Filters the label displayed next to the library search box.

Arguments

  • $label (string): The label value supplied to this hook.

Return

string: The filtered $label value.

add_filter( 'document_library_pro_search_label', function( $label ) {
    return 'Search documents:';
} );

document_library_pro_search_placeholder

Filters the placeholder displayed inside the library search box.

Arguments

  • $placeholder (string): The placeholder value supplied to this hook.

Return

string: The filtered $placeholder value.

add_filter( 'document_library_pro_search_placeholder', function( $placeholder ) {
    return 'Enter a keyword';
} );

document_library_pro_search_filter_label

Filters the label used for dropdown filters. Include %1$s where the filter name should appear.

Arguments

  • $label (string): The label value supplied to this hook.

Return

string: The filtered $label value.

add_filter( 'document_library_pro_search_filter_label', function( $label ) {
    return 'Filter by %1$s';
} );

document_library_pro_reset_button

Filters the text of the filter reset button.

Arguments

  • $label (string): The label value supplied to this hook.

Return

string: The filtered $label value.

add_filter( 'document_library_pro_reset_button', function( $label ) {
    return 'Clear filters';
} );

document_library_pro_minimum_search_term_length

Sets the minimum number of characters required before a search is performed. The default is 2 for tables and 3 in the folder and grid interfaces.

Arguments

  • $length (int): The length value supplied to this hook.

Return

int: The filtered $length value.

add_filter( 'document_library_pro_minimum_search_term_length', function( $length ) {
    return 5;
} );

document_library_pro_more_content_text

Filters the text or HTML appended when content or excerpts are truncated. The default is ….

Arguments

  • $more_text (string): The more text value supplied to this hook.

Return

string: The filtered $more_text value.

add_filter( 'document_library_pro_more_content_text', function( $more_text ) {
    return ' [...]';
} );

document_library_pro_enable_ms_office_preview

Filters whether Word, Excel and PowerPoint documents can be previewed with the Microsoft Office viewer.

Arguments

  • $enabled (bool): The enabled value supplied to this hook.

Return

bool: The filtered $enabled value.

add_filter( 'document_library_pro_enable_ms_office_preview', '__return_false' );

Library arguments and configuration

document_library_pro_table_default_args

Filters the default arguments for document libraries.

Arguments

  • $defaults (array): The defaults value supplied to this hook.

Return

array: The filtered $defaults value.

add_filter( 'document_library_pro_table_default_args', function( $defaults ) {
    $defaults['search_on_click'] = false;
    return $defaults;
}, 20 );

document_library_pro_site_default_args

Filters the site defaults after the base defaults have been loaded and before individual library arguments are merged.
The deprecated alias is document_library_pro_user_default_args.

Arguments

  • $defaults (array): The defaults value supplied to this hook.

Return

array: The filtered $defaults value.

add_filter( 'document_library_pro_site_default_args', function( $defaults ) {
    $defaults['rows_per_page'] = 50;
    return $defaults;
} );

document_library_pro_default_args

Filters the data source defaults used by Document Library Pro.

Arguments

  • $defaults (array): The defaults value supplied to this hook.

Return

array: The filtered $defaults value.

add_filter( 'document_library_pro_default_args', function( $defaults ) {
    return $defaults;
} );

document_library_pro_filled_args

Filters the merged arguments passed to dlp_get_doc_library() before the layout is selected.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'document_library_pro_filled_args', function( $args ) {
    return $args;
} );

document_library_pro_default_grid_args

Filters the arguments used for grid libraries after defaults and supplied arguments have been merged.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'document_library_pro_default_grid_args', function( $args ) {
    $args['rows_per_page'] = 12;
    return $args;
} );

document_library_pro_view_args

Filters the argument array immediately before a document view is created.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'document_library_pro_view_args', function( $args ) {
    return $args;
} );

document_library_pro_view_default_args

Filters the default view arguments after the table defaults have been applied.

Arguments

  • $defaults (array): The defaults value supplied to this hook.

Return

array: The filtered $defaults value.

add_filter( 'document_library_pro_view_default_args', function( $defaults ) {
    return $defaults;
} );

document_library_pro_args_validation

Filters the validation rules for library arguments.

Arguments

  • $validation (mixed): The validation value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

mixed: The filtered $validation value.

add_filter( 'document_library_pro_args_validation', function( $validation, $args ) {
    return $validation;
}, 10, 2 );

document_library_pro_column_defaults

Filters the default heading and responsive priority for every built-in column.

Arguments

  • $defaults (array): The defaults value supplied to this hook.

Return

array: The filtered $defaults value.

add_filter( 'document_library_pro_column_defaults', function( $defaults ) {
    $defaults['title']['heading'] = 'Document';
    return $defaults;
} );

document_library_pro_column_heading_<column>

Filters the heading for an individual column.

Arguments

  • $heading (string): The heading value supplied to this hook.

Return

string: The filtered $heading value.

add_filter( 'document_library_pro_column_heading_title', function( $heading ) {
    return 'Document';
} );

document_library_pro_column_priority_<column>

Filters an individual column's responsive priority.

Arguments

  • $priority (int): The priority value supplied to this hook.

Return

int: The filtered $priority value.

add_filter( 'document_library_pro_column_priority_date', function( $priority ) {
    return 10;
} );

document_library_pro_column_width_<column>

Filters an individual column's width.

Arguments

  • $width (mixed): The width value supplied to this hook.

Return

mixed: The filtered $width value.

add_filter( 'document_library_pro_column_width_doc_author', function( $width ) {
    return '100px';
} );

document_library_pro_column_class_<column>

Filters the CSS classes for an individual legacy DataTables column.

Arguments

  • $classes (string): The classes value supplied to this hook.

Return

string: The filtered $classes value.

add_filter( 'document_library_pro_column_class_title', function( $classes ) {
    $classes[] = 'highlight';
    return $classes;
} );

document_library_pro_header_class_<column>

Filters the CSS classes placed on an individual table header cell.

Arguments

  • $classes (string): The classes value supplied to this hook.

Return

string: The filtered $classes value.

add_filter( 'document_library_pro_header_class_title', function( $classes ) {
    $classes[] = 'document-heading';
    return $classes;
} );

document_library_pro_column_click_filterable_<column>

Filters whether values in an individual column can be clicked to filter the library.

Arguments

  • $value (string): The value value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_column_click_filterable_doc_categories', '__return_false' );

document_library_pro_column_searchable

Filters whether all columns are searchable. It receives the current value and normalized column name.

Arguments

  • $searchable (mixed): The searchable value supplied to this hook.
  • $column (mixed): The column value supplied to this hook.

Return

mixed: The filtered $searchable value.

add_filter( 'document_library_pro_column_searchable', function( $searchable, $column ) {
    return 'filename' === $column ? true : $searchable;
}, 10, 2 );

document_library_pro_column_searchable_<column>

Filters whether an individual column is included in searches. For custom fields and taxonomies, omit the cf: or tax: prefix from the hook name.

Arguments

  • $value (string): The value value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_column_searchable_title', '__return_false' );

document_library_pro_column_sortable

Filters whether all columns are sortable. It receives the current value and normalized column name.

Arguments

  • $sortable (mixed): The sortable value supplied to this hook.
  • $column (mixed): The column value supplied to this hook.

Return

mixed: The filtered $sortable value.

add_filter( 'document_library_pro_column_sortable', function( $sortable, $column ) {
    return $sortable;
}, 10, 2 );

document_library_pro_column_sortable_<column>

Filters whether an individual column is sortable.

Arguments

  • $value (string): The value value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_column_sortable_title', '__return_false' );

document_library_pro_separator

Filters the separator for every multi-value column after the type-specific separator has been filtered.

Arguments

  • $separator (string): The separator value supplied to this hook.

Return

string: The filtered $separator value.

add_filter( 'document_library_pro_separator', function( $separator ) {
    return $separator;
} );

document_library_pro_separator_<type>

Filters the separator for one multi-value data type. Types include categories, tags, terms, custom_field, and custom_field_row.

Arguments

  • $separator (string): The separator value supplied to this hook.

Return

string: The filtered $separator value.

add_filter( 'document_library_pro_separator_categories', function( $separator ) {
    return '<br>';
} );

document_library_pro_custom_class

Filters additional CSS classes for the table element. The current view is passed as the second argument.

Arguments

  • $class (string): The class value supplied to this hook.
  • $view (object): The view value supplied to this hook.

Return

string: The filtered $class value.

add_filter( 'document_library_pro_custom_class', function( $class, $view ) {
    return trim( $class . ' featured-library' );
}, 10, 2 );

document_library_pro_wrapper_class

Filters the library wrapper classes. The DataViews engine passes the view arguments as the second parameter.

Arguments

  • $classes (string): The classes value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

string: The filtered $classes value.

add_filter( 'document_library_pro_wrapper_class', function( $classes, $args = null ) {
    return $classes . ' custom-wrapper';
}, 10, 2 );

document_library_pro_class

Filters the main legacy table CSS class.

Arguments

  • $class (string): The class value supplied to this hook.

Return

string: The filtered $class value.

add_filter( 'document_library_pro_class', function( $class ) {
    return $class . ' custom-table';
} );

document_library_pro_row_attributes

Filters the attributes added to each table row.

Arguments

  • $attributes (array): The attributes value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

array: The filtered $attributes value.

add_filter( 'document_library_pro_row_attributes', function( $attributes, $post ) {
    $attributes['data-document-id'] = $post->ID;
    return $attributes;
}, 10, 2 );

document_library_pro_update_post_selection_args

Filters post-selection arguments when the view updates its selected documents.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'document_library_pro_update_post_selection_args', function( $args ) {
    return $args;
} );

document_library_pro_get_table_output

Filters final table output. It receives the result array, output mode and view object.

Arguments

  • $result (mixed): The result value supplied to this hook.
  • $output (mixed): The output value supplied to this hook.
  • $view (object): The view value supplied to this hook.

Return

mixed: The filtered $result value.

add_filter( 'document_library_pro_get_table_output', function( $result, $output, $view ) {
    return $result;
}, 10, 3 );

document_library_pro_get_data_output

Filters final data-only output. It receives the result array, output mode and view object.

Arguments

  • $result (mixed): The result value supplied to this hook.
  • $output (mixed): The output value supplied to this hook.
  • $view (object): The view value supplied to this hook.

Return

mixed: The filtered $result value.

add_filter( 'document_library_pro_get_data_output', function( $result, $output, $view ) {
    return $result;
}, 10, 3 );

document_library_pro_open_posts_in_new_tab

Controls whether links to single document pages open in a new tab.

Arguments

  • $new_tab (bool): The new tab value supplied to this hook.

Return

bool: The filtered $new_tab value.

add_filter( 'document_library_pro_open_posts_in_new_tab', '__return_true' );

document_library_pro_process_shortcodes

Controls whether shortcodes in document content are processed globally.

Arguments

  • $process (bool): The process value supplied to this hook.

Return

bool: The filtered $process value.

add_filter( 'document_library_pro_process_shortcodes', '__return_true' );

document_library_pro_maybe_strip_shortcodes_tag

Filters the shortcode tag which the content processor protects while stripping nested shortcodes.

Arguments

  • $tag (mixed): The tag value supplied to this hook.

Return

mixed: The filtered $tag value.

add_filter( 'document_library_pro_maybe_strip_shortcodes_tag', function( $tag ) {
    return $tag;
} );

document_library_pro_button_column_button_text

Filters the text used for button-column and document action buttons.

Arguments

  • $text (string): The text value supplied to this hook.

Return

string: The filtered $text value.

add_filter( 'document_library_pro_button_column_button_text', function( $text ) {
    return '<span>' . $text . '</span>';
} );

document_library_pro_button_column_button_class

Filters the CSS classes used for button-column and document action buttons.

Arguments

  • $class (string): The class value supplied to this hook.

Return

string: The filtered $class value.

add_filter( 'document_library_pro_button_column_button_class', function( $class ) {
    return $class . ' custom-button';
} );

document_library_pro_button_class

Filters the final class for a download or preview button.

Arguments

  • $class (string): The class value supplied to this hook.
  • $type (string): The type value supplied to this hook.
  • $text (string): The text value supplied to this hook.
  • $style (string): The style value supplied to this hook.
  • $icon (mixed): The icon value supplied to this hook.
  • $destination (string): The destination value supplied to this hook.
  • $target_or_attributes (array): The target or attributes value supplied to this hook.
  • $button_attributes (array): The button attributes value supplied to this hook.

Return

string: The filtered $class value.

add_filter( 'document_library_pro_button_class', function( $class, $type ) {
    return $class . ' document-' . $type;
}, 10, 2 );

document_library_pro_download_button_should_display

Filters whether a download button is displayed.

Arguments

  • $display (bool): The display value supplied to this hook.
  • $document (object): The document value supplied to this hook.
  • $text (string): The text value supplied to this hook.
  • $style (string): The style value supplied to this hook.
  • $destination (string): The destination value supplied to this hook.

Return

bool: The filtered $display value.

add_filter( 'document_library_pro_download_button_should_display', function( $display, $document, $text, $style, $destination ) {
    return $display;
}, 10, 5 );

document_library_pro_preview_button_should_display

Filters whether a preview button is displayed.

Arguments

  • $display (bool): The display value supplied to this hook.
  • $document (object): The document value supplied to this hook.
  • $text (string): The text value supplied to this hook.
  • $style (string): The style value supplied to this hook.
  • $view (object): The view value supplied to this hook.

Return

bool: The filtered $display value.

add_filter( 'document_library_pro_preview_button_should_display', function( $display, $document, $text, $style, $view ) {
    return $display;
}, 10, 5 );

document_library_pro_download_checkboxes_should_display

Filters whether multi-download checkboxes are displayed.

Arguments

  • $display (bool): The display value supplied to this hook.
  • $document (object): The document value supplied to this hook.
  • $text (string): The text value supplied to this hook.
  • $style (string): The style value supplied to this hook.
  • $destination (string): The destination value supplied to this hook.

Return

bool: The filtered $display value.

add_filter( 'document_library_pro_download_checkboxes_should_display', function( $display, $document, $text, $style, $destination ) {
    return $display;
}, 10, 5 );

Filters the destination generated for filename links.

Arguments

  • $url (string): The url value supplied to this hook.
  • $document (object): The document value supplied to this hook.

Return

string: The filtered $url value.

add_filter( 'document_library_pro_filename_link_destination', function( $url, $document ) {
    return $url;
}, 10, 2 );

Filters the destination generated for title links.

Arguments

  • $url (string): The url value supplied to this hook.
  • $document (object): The document value supplied to this hook.

Return

string: The filtered $url value.

add_filter( 'document_library_pro_title_link_destination', function( $url, $document ) {
    return $url;
}, 10, 2 );

document_library_pro_preview_url

Filters a document's preview URL.

Arguments

  • $url (string): The url value supplied to this hook.
  • $document (object): The document value supplied to this hook.

Return

string: The filtered $url value.

add_filter( 'document_library_pro_preview_url', function( $url, $document ) {
    return $url;
}, 10, 2 );

document_library_pro_custom_fields

Filters the custom fields attached to a document model.

Arguments

  • $fields (array): The fields value supplied to this hook.
  • $document_id (int): The document id value supplied to this hook.

Return

array: The filtered $fields value.

add_filter( 'document_library_pro_custom_fields', function( $fields, $document_id ) {
    return $fields;
}, 10, 2 );

Controls whether an image document file can be used as its featured image.

Arguments

  • $use_file (bool): The use file value supplied to this hook.
  • $document (object): The document value supplied to this hook.
  • $attachment_id (int): The attachment id value supplied to this hook.

Return

bool: The filtered $use_file value.

add_filter( 'document_library_pro_use_file_as_featured_image', function( $use_file, $document, $attachment_id ) {
    return $use_file;
}, 10, 3 );

document_library_pro_use_block_button_markup

Controls whether frontend buttons use WordPress block button markup.

Arguments

  • $value (string): The value value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_use_block_button_markup', '__return_true' );

document_library_pro_icon_svg

Filters the complete map of SVG icons used by document buttons and file types.

Arguments

  • $icons (mixed): The icons value supplied to this hook.

Return

mixed: The filtered $icons value.

add_filter( 'document_library_pro_icon_svg', function( $icons ) {
    return $icons;
} );

document_library_pro_file_type_icon_map

Filters the map between file extensions or MIME types and icon identifiers.

Arguments

  • $map (array): The map value supplied to this hook.

Return

array: The filtered $map value.

add_filter( 'document_library_pro_file_type_icon_map', function( $map ) {
    $map['md'] = 'document';
    return $map;
} );

Grid and image output

document_library_pro_grid_html

Filters the complete HTML for a grid card.

Arguments

  • $html (string): The html value supplied to this hook.
  • $document (object): The document value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $templates (mixed): The templates value supplied to this hook.

Return

string: The filtered $html value.

add_filter( 'document_library_pro_grid_html', function( $html, $document, $args, $templates ) {
    return $html;
}, 10, 4 );

document_library_pro_grid_templates

Filters the template map used to build a grid card.

Arguments

  • $templates (mixed): The templates value supplied to this hook.
  • $document (object): The document value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $loader (object): The grid template loader.

Return

mixed: The filtered $templates value.

add_filter( 'document_library_pro_grid_templates', function( $templates, $document, $args, $loader ) {
    return $templates;
}, 10, 4 );

document_library_pro_grid_image

Filters a grid card's image HTML.

Arguments

  • $image (mixed): The image value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

mixed: The filtered $image value.

add_filter( 'document_library_pro_grid_image', function( $image, $post ) {
    return $image;
}, 10, 2 );

document_library_pro_get_grid_output

Filters final grid output. It receives the result, output mode and grid or view object.

Arguments

  • $result (mixed): The result value supplied to this hook.
  • $output (mixed): The output value supplied to this hook.
  • $grid (int): The grid value supplied to this hook.

Return

mixed: The filtered $result value.

add_filter( 'document_library_pro_get_grid_output', function( $result, $output, $grid ) {
    return $result;
}, 10, 3 );

document_library_pro_image_full_size

Filters the image full size value.

Arguments

  • $size (int): The size value supplied to this hook.

Return

int: The filtered $size value.

add_filter( 'document_library_pro_image_full_size', function( $size ) {
    return $size;
}, 10, 1 );

document_library_pro_image_large_size

Filters the image large size value.

Arguments

  • $size (int): The size value supplied to this hook.

Return

int: The filtered $size value.

add_filter( 'document_library_pro_image_large_size', function( $size ) {
    return $size;
}, 10, 1 );

document_library_pro_image_medium_size

Filters the image medium size value.

Arguments

  • $size (int): The size value supplied to this hook.

Return

int: The filtered $size value.

add_filter( 'document_library_pro_image_medium_size', function( $size ) {
    return $size;
}, 10, 1 );

document_library_pro_image_grid_size

Filters the image grid size value.

Arguments

  • $size (int): The size value supplied to this hook.

Return

int: The filtered $size value.

add_filter( 'document_library_pro_image_grid_size', function( $size ) {
    return $size;
}, 10, 1 );

document_library_pro_image_single_size

Filters the image single size value.

Arguments

  • $size (int): The size value supplied to this hook.

Return

int: The filtered $size value.

add_filter( 'document_library_pro_image_single_size', function( $size ) {
    return $size;
}, 10, 1 );

document_library_pro_image_grid_sizes

Filters the responsive sizes attribute for grid images.

Arguments

  • $sizes (int): The sizes value supplied to this hook.
  • $attachment_id (int): The attachment id value supplied to this hook.

Return

int: The filtered $sizes value.

add_filter( 'document_library_pro_image_grid_sizes', function( $sizes, $attachment_id ) {
    return $sizes;
}, 10, 2 );

document_library_pro_image_grid_srcset

Filters the responsive srcset attribute for grid images.

Arguments

  • $srcset (mixed): The srcset value supplied to this hook.
  • $attachment_id (int): The attachment id value supplied to this hook.

Return

mixed: The filtered $srcset value.

add_filter( 'document_library_pro_image_grid_srcset', function( $srcset, $attachment_id ) {
    return $srcset;
}, 10, 2 );

Single document output

document_library_pro_enable_single_content_customization

Controls all plugin customization of single-document content.

Arguments

  • $enabled (bool): The enabled value supplied to this hook.

Return

bool: The filtered $enabled value.

add_filter( 'document_library_pro_enable_single_content_customization', '__return_false' );

document_library_pro_show_details_in_single_content

Controls whether the document details list is added to single-document content.

Arguments

  • $show (bool): The show value supplied to this hook.

Return

bool: The filtered $show value.

add_filter( 'document_library_pro_show_details_in_single_content', '__return_false' );

document_library_pro_enable_single_document_excerpt

Controls whether the excerpt field is enabled for the document post type.

Arguments

  • $enabled (bool): The enabled value supplied to this hook.

Return

bool: The filtered $enabled value.

add_filter( 'document_library_pro_enable_single_document_excerpt', '__return_true' );

Caching, performance and scripts

document_library_pro_use_data_cache

Controls whether the rendered data cache is used for a library.

Arguments

  • $enabled (bool): The enabled value supplied to this hook.
  • $cache (object): The cache value supplied to this hook.

Return

bool: The filtered $enabled value.

add_filter( 'document_library_pro_use_data_cache', function( $enabled, $cache ) {
    return $enabled;
}, 10, 2 );

document_library_pro_data_cache_expiry

Filters the rendered data cache lifetime in seconds.

Arguments

  • $expiry (int): The expiry value supplied to this hook.
  • $cache (object): The cache value supplied to this hook.

Return

int: The filtered $expiry value.

add_filter( 'document_library_pro_data_cache_expiry', function( $expiry, $cache ) {
    return 3 * DAY_IN_SECONDS;
}, 10, 2 );

document_library_pro_max_cache_size

Filters the maximum number of rows which can be stored in the rendered data cache.

Arguments

  • $size (int): The size value supplied to this hook.
  • $cache (object): The cache value supplied to this hook.

Return

int: The filtered $size value.

add_filter( 'document_library_pro_max_cache_size', function( $size, $cache ) {
    return 1000;
}, 10, 2 );

document_library_pro_load_frontend_scripts

Controls whether Document Library Pro loads its frontend scripts and styles.

Arguments

  • $load (bool): The load value supplied to this hook.

Return

bool: The filtered $load value.

add_filter( 'document_library_pro_load_frontend_scripts', '__return_false' );

document_library_pro_use_fitvids

Controls whether the legacy FitVids script is used for responsive video content.

Arguments

  • $enabled (bool): The enabled value supplied to this hook.

Return

bool: The filtered $enabled value.

add_filter( 'document_library_pro_use_fitvids', '__return_false' );

document_library_pro_enable_select2

Controls whether Select2 enhances legacy filter and page-length dropdowns.

Arguments

  • $enabled (bool): The enabled value supplied to this hook.

Return

bool: The filtered $enabled value.

add_filter( 'document_library_pro_enable_select2', '__return_false' );

document_library_pro_script_params

Filters parameters passed to the legacy frontend script. The deprecated alias is document_library_pro_pro_script_params.

Arguments

  • $params (mixed): The params value supplied to this hook.

Return

mixed: The filtered $params value.

add_filter( 'document_library_pro_script_params', function( $params ) {
    return $params;
} );

Import, upload, media and permissions

document_library_pro_import_capability

Filters the capability required to access document importers.

Arguments

  • $capability (mixed): The capability value supplied to this hook.

Return

mixed: The filtered $capability value.

add_filter( 'document_library_pro_import_capability', function( $capability ) {
    return 'manage_options';
} );

document_library_pro_settings_page_capability

Filters the capability required to access Document Library Pro settings.

Arguments

  • $capability (mixed): The capability value supplied to this hook.

Return

mixed: The filtered $capability value.

add_filter( 'document_library_pro_settings_page_capability', function( $capability ) {
    return 'manage_options';
} );

document_library_pro_admin_available_roles

Filters the roles shown in access-control settings.

Arguments

  • $roles (mixed): The roles value supplied to this hook.

Return

mixed: The filtered $roles value.

add_filter( 'document_library_pro_admin_available_roles', function( $roles ) {
    unset( $roles['subscriber'] );
    return $roles;
} );

document_library_pro_enable_media_filter

Controls whether the Document Library Pro filter is added to the WordPress Media Library.

Arguments

  • $enabled (bool): The enabled value supplied to this hook.

Return

bool: The filtered $enabled value.

add_filter( 'document_library_pro_enable_media_filter', '__return_false' );

document_library_pro_enable_auto_thumbnail_task

Controls whether the automatic document thumbnail task is registered.

Arguments

  • $enabled (bool): The enabled value supplied to this hook.

Return

bool: The filtered $enabled value.

add_filter( 'document_library_pro_enable_auto_thumbnail_task', '__return_false' );

document_library_pro_auto_thumbnail_batch_size

Filters the number of documents processed in an automatic-thumbnail batch. The default is 100.

Arguments

  • $size (int): The size value supplied to this hook.

Return

int: The filtered $size value.

add_filter( 'document_library_pro_auto_thumbnail_batch_size', function( $size ) {
    return 50;
} );

document_library_pro_import_document_url

Filters the import document url value.

Arguments

  • $document_url (object): The document url value supplied to this hook.

Return

object: The filtered $document_url value.

add_filter( 'document_library_pro_import_document_url', function( $document_url ) {
    return $document_url;
}, 10, 1 );

document_library_pro_import_mimes_allowed

Filters the import mimes allowed value.

Arguments

  • $mimes (array): The mimes value supplied to this hook.

Return

array: The filtered $mimes value.

add_filter( 'document_library_pro_import_mimes_allowed', function( $mimes ) {
    return $mimes;
}, 10, 1 );

document_library_pro_import_file_array

Filters the import file array value.

Arguments

  • $file_array (mixed): The file array value supplied to this hook.
  • $document_url (object): The document url value supplied to this hook.

Return

mixed: The filtered $file_array value.

add_filter( 'document_library_pro_import_file_array', function( $file_array, $document_url ) {
    return $file_array;
}, 10, 2 );

document_library_pro_csv_importer_batch_size

Filters the csv importer batch size value.

Arguments

  • $batch_size (int): The batch size value supplied to this hook.

Return

int: The filtered $batch_size value.

add_filter( 'document_library_pro_csv_importer_batch_size', function( $batch_size ) {
    return $batch_size;
}, 10, 1 );

document_library_pro_csv_importer_default_time_limit

Filters the csv importer default time limit value.

Arguments

  • $time_limit (int): The time limit value supplied to this hook.

Return

int: The filtered $time_limit value.

add_filter( 'document_library_pro_csv_importer_default_time_limit', function( $time_limit ) {
    return $time_limit;
}, 10, 1 );

document_library_pro_csv_importer_time_exceeded

Filters the csv importer time exceeded value.

Arguments

  • $exceeded (bool): The exceeded value supplied to this hook.

Return

bool: The filtered $exceeded value.

add_filter( 'document_library_pro_csv_importer_time_exceeded', function( $exceeded ) {
    return $exceeded;
}, 10, 1 );

document_library_pro_csv_importer_memory_exceeded

Filters the csv importer memory exceeded value.

Arguments

  • $exceeded (bool): The exceeded value supplied to this hook.

Return

bool: The filtered $exceeded value.

add_filter( 'document_library_pro_csv_importer_memory_exceeded', function( $exceeded ) {
    return $exceeded;
}, 10, 1 );

document_library_pro_csv_importer_check_import_file_path

Filters the csv importer check import file path value.

Arguments

  • $check_path (bool): The check path value supplied to this hook.

Return

bool: The filtered $check_path value.

add_filter( 'document_library_pro_csv_importer_check_import_file_path', function( $check_path ) {
    return $check_path;
}, 10, 1 );

document_library_pro_csv_importer_valid_filetypes

Filters the csv importer valid filetypes value.

Arguments

  • $file_types (array): The file types value supplied to this hook.

Return

array: The filtered $file_types value.

add_filter( 'document_library_pro_csv_importer_valid_filetypes', function( $file_types ) {
    return $file_types;
}, 10, 1 );

document_library_pro_csv_importer_mapping_default_columns

Filters the csv importer mapping default columns value.

Arguments

  • $columns (array): The columns value supplied to this hook.
  • $raw_headers (array): The raw headers value supplied to this hook.

Return

array: The filtered $columns value.

add_filter( 'document_library_pro_csv_importer_mapping_default_columns', function( $columns, $raw_headers ) {
    return $columns;
}, 10, 2 );

document_library_pro_csv_importer_mapping_special_columns

Filters the csv importer mapping special columns value.

Arguments

  • $columns (array): The columns value supplied to this hook.
  • $raw_headers (array): The raw headers value supplied to this hook.

Return

array: The filtered $columns value.

add_filter( 'document_library_pro_csv_importer_mapping_special_columns', function( $columns, $raw_headers ) {
    return $columns;
}, 10, 2 );

document_library_pro_csv_importer_mapped_columns

Filters the csv importer mapped columns value.

Arguments

  • $headers (array): The headers value supplied to this hook.
  • $raw_headers (array): The raw headers value supplied to this hook.

Return

array: The filtered $headers value.

add_filter( 'document_library_pro_csv_importer_mapped_columns', function( $headers, $raw_headers ) {
    return $headers;
}, 10, 2 );

document_library_pro_csv_importer_mapping_options

Filters the csv importer mapping options value.

Arguments

  • $options (array): The options value supplied to this hook.
  • $item (mixed): The item value supplied to this hook.

Return

array: The filtered $options value.

add_filter( 'document_library_pro_csv_importer_mapping_options', function( $options, $item ) {
    return $options;
}, 10, 2 );

document_library_pro_csv_importer_formatting_callbacks

Filters the csv importer formatting callbacks value.

Arguments

  • $callbacks (array): The callbacks value supplied to this hook.
  • $importer (object): The importer value supplied to this hook.

Return

array: The filtered $callbacks value.

add_filter( 'document_library_pro_csv_importer_formatting_callbacks', function( $callbacks, $importer ) {
    return $callbacks;
}, 10, 2 );

document_library_pro_csv_importer_parsed_data

Filters the csv importer parsed data value.

Arguments

  • $parsed_data (array): The parsed data value supplied to this hook.
  • $importer (object): The importer value supplied to this hook.

Return

array: The filtered $parsed_data value.

add_filter( 'document_library_pro_csv_importer_parsed_data', function( $parsed_data, $importer ) {
    return $parsed_data;
}, 10, 2 );

document_library_pro_csv_importer_pre_expand_data

Filters the csv importer pre expand data value.

Arguments

  • $data (array): The data value supplied to this hook.

Return

array: The filtered $data value.

add_filter( 'document_library_pro_csv_importer_pre_expand_data', function( $data ) {
    return $data;
}, 10, 1 );

document_library_pro_csv_importer_process_item_data

Filters the csv importer process item data value.

Arguments

  • $data (array): The data value supplied to this hook.

Return

array: The filtered $data value.

add_filter( 'document_library_pro_csv_importer_process_item_data', function( $data ) {
    return $data;
}, 10, 1 );

document_library_pro_plupload_options

Filters initialization options for the drag-and-drop importer's Plupload instance.

Arguments

  • $options (array): The options value supplied to this hook.

Return

array: The filtered $options value.

add_filter( 'document_library_pro_plupload_options', function( $options ) {
    return $options;
} );

Filters the document link button text value.

Arguments

  • $text (string): The text value supplied to this hook.
  • $document (object): The document value supplied to this hook.

Return

string: The filtered $text value.

add_filter( 'document_library_pro_document_link_button_text', function( $text, $document ) {
    return $text;
}, 10, 2 );

Filters the document link file attachment details class value.

Arguments

  • $class (string): The class value supplied to this hook.

Return

string: The filtered $class value.

add_filter( 'document_library_pro_document_link_file_attachment_details_class', function( $class ) {
    return $class;
}, 10, 1 );

Filters the document link url details class value.

Arguments

  • $class (string): The class value supplied to this hook.

Return

string: The filtered $class value.

add_filter( 'document_library_pro_document_link_url_details_class', function( $class ) {
    return $class;
}, 10, 1 );

Frontend submission form

document_library_pro_form_fields

Filters fields displayed on the frontend submission form.

Arguments

  • $fields (array): The fields value supplied to this hook.

Return

array: The filtered $fields value.

add_filter( 'document_library_pro_form_fields', function( $fields ) {
    $fields['title']['label'] = 'Document title';
    return $fields;
} );

document_library_pro_form_terms

Filters taxonomy terms returned to the submission form REST endpoint.

Arguments

  • $terms (array): The terms value supplied to this hook.
  • $taxonomy (string): The taxonomy value supplied to this hook.

Return

array: The filtered $terms value.

add_filter( 'document_library_pro_form_terms', function( $terms, $taxonomy ) {
    return $terms;
}, 10, 2 );

dlp_forms_get_terms

Filters the arguments used to retrieve taxonomy terms for the submission form.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $taxonomy (string): The taxonomy value supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'dlp_forms_get_terms', function( $args, $taxonomy ) {
    $args['hide_empty'] = false;
    return $args;
}, 10, 2 );

dlp_get_posted_fields

Filters all values posted by the frontend submission form.

Arguments

  • $values (string): The values value supplied to this hook.
  • $fields (array): The fields value supplied to this hook.

Return

string: The filtered $values value.

add_filter( 'dlp_get_posted_fields', function( $values, $fields ) {
    return $values;
}, 10, 2 );

dlp_get_posted_<field_type>_field

Filters the custom handler for a posted field type.

Arguments

  • $handler (mixed): The handler value supplied to this hook.

Return

mixed: The filtered $handler value.

add_filter( 'dlp_get_posted_reference_field', function( $handler ) {
    return $handler;
} );

dlp_submission_form_validate_fields

Runs final frontend form validation. Throw an Exception to display a validation error.

Arguments

  • $is_valid (int): The is valid value supplied to this hook.
  • $fields (array): The fields value supplied to this hook.
  • $values (string): The values value supplied to this hook.

Return

int: The filtered $is_valid value.

add_filter( 'dlp_submission_form_validate_fields', function( $is_valid, $fields, $values ) {
    if ( empty( $values['title'] ) ) {
        throw new Exception( 'Please enter a document title.' );
    }
    return $is_valid;
}, 20, 3 );

dlp_form_validate_fields_empty_values

Filters the values which count as empty during required-field validation. The field key is the second argument.

Arguments

  • $empty_values (string): The empty values value supplied to this hook.
  • $field_key (string): The field key value supplied to this hook.

Return

string: The filtered $empty_values value.

add_filter( 'dlp_form_validate_fields_empty_values', function( $empty_values, $field_key ) {
    return $empty_values;
}, 10, 2 );

document_library_pro_form_redirect

Filters the URL used after a successful frontend submission.

Arguments

  • $url (string): The url value supplied to this hook.
  • $values (string): The values value supplied to this hook.
  • $document_id (int): The document id value supplied to this hook.

Return

string: The filtered $url value.

add_filter( 'document_library_pro_form_redirect', function( $url, $values, $document_id ) {
    return get_permalink( $document_id );
}, 10, 3 );

dlp_form_wp_editor_args

Filters the wp_editor() settings used by editor fields.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'dlp_form_wp_editor_args', function( $args ) {
    $args['media_buttons'] = true;
    return $args;
} );

dlp_upload_file_pre_upload

Filters the upload file pre upload value.

Arguments

  • $file (array): The uploaded file data.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $allowed_mime_types (array): MIME types allowed by the field configuration.

Return

array|WP_Error: The filtered file data, or a WP_Error to reject the upload.

add_filter( 'dlp_upload_file_pre_upload', function( $file, $args, $allowed_mime_types ) {
    return $file;
}, 10, 3 );

dlp_handle_upload_overrides

Filters the handle upload overrides value.

Arguments

  • $overrides (array): The overrides value supplied to this hook.

Return

array: The filtered $overrides value.

add_filter( 'dlp_handle_upload_overrides', function( $overrides ) {
    return $overrides;
}, 10, 1 );

dlp_reject_external_files

Filters the reject external files value.

Arguments

  • $reject (bool): The reject value supplied to this hook.
  • $field_key (string): The field key value supplied to this hook.
  • $field (string): The field value supplied to this hook.

Return

bool: The filtered $reject value.

add_filter( 'dlp_reject_external_files', function( $reject, $field_key, $field ) {
    return $reject;
}, 10, 3 );

dlp_upload_dir

Filters the upload dir value.

Arguments

  • $directory (string): The directory value supplied to this hook.
  • $upload_id (string): The sanitized upload identifier.

Return

string: The filtered $directory value.

add_filter( 'dlp_upload_dir', function( $directory, $upload_id ) {
    return $directory;
}, 10, 2 );

Lead capture

document_library_pro_lead_capture_form_vars

Filters template variables used to render the lead capture popup.

Arguments

  • $variables (mixed): The variables value supplied to this hook.

Return

mixed: The filtered $variables value.

add_filter( 'document_library_pro_lead_capture_form_vars', function( $variables ) {
    return $variables;
} );

Filters the lead capture cookie lifetime in seconds.

Arguments

  • $expiration (mixed): The expiration value supplied to this hook.

Return

mixed: The filtered $expiration value.

add_filter( 'dlp_lead_capture_cookie_expiration', function( $expiration ) {
    return 30 * DAY_IN_SECONDS;
} );

dlp_lead_capture_email_config

Filters the email configuration generated for a lead capture submission.

Arguments

  • $mail (mixed): The mail value supplied to this hook.
  • $lead_data (array): The lead data value supplied to this hook.

Return

mixed: The filtered $mail value.

add_filter( 'dlp_lead_capture_email_config', function( $mail, $lead_data ) {
    return $mail;
}, 10, 2 );

Login and access control

dlp_login_shortcode_tag

Filters the login shortcode tag. The default is doc_library_login.

Arguments

  • $tag (mixed): The tag value supplied to this hook.

Return

mixed: The filtered $tag value.

add_filter( 'dlp_login_shortcode_tag', function( $tag ) {
    return $tag;
} );

dlp_login_columns_wrap_class

Filters the login columns wrap class value.

Arguments

  • $class (string): The class value supplied to this hook.

Return

string: The filtered $class value.

add_filter( 'dlp_login_columns_wrap_class', function( $class ) {
    return $class;
}, 10, 1 );

dlp_password_column_class

Filters the password column class value.

Arguments

  • $class (string): The class value supplied to this hook.

Return

string: The filtered $class value.

add_filter( 'dlp_password_column_class', function( $class ) {
    return $class;
}, 10, 1 );

dlp_user_column_class

Filters the user column class value.

Arguments

  • $class (string): The class value supplied to this hook.

Return

string: The filtered $class value.

add_filter( 'dlp_user_column_class', function( $class ) {
    return $class;
}, 10, 1 );

dlp_user_permission_notice_message

Filters the message shown when a user is logged in but does not have permission to view protected content.

Arguments

  • $message (mixed): The message value supplied to this hook.
  • $protection_types (array): The protection types value supplied to this hook.
  • $context (string): The context value supplied to this hook.
  • $can_use_password (bool): The can use password value supplied to this hook.

Return

mixed: The filtered $message value.

add_filter( 'dlp_user_permission_notice_message', function( $message, $protection_types, $context, $can_use_password ) {
    return $message;
}, 10, 4 );

document_library_pro_current_user_allowed_by_role

Filters the current user allowed by role value.

Arguments

  • $allowed (bool): The allowed value supplied to this hook.
  • $object_id (int): The object id value supplied to this hook.

Return

bool: The filtered $allowed value.

add_filter( 'document_library_pro_current_user_allowed_by_role', function( $allowed, $object_id ) {
    return $allowed;
}, 10, 2 );

document_library_pro_current_user_allowed_by_id

Filters the current user allowed by id value.

Arguments

  • $allowed (bool): The allowed value supplied to this hook.
  • $category_id (int): The category id value supplied to this hook.

Return

bool: The filtered $allowed value.

add_filter( 'document_library_pro_current_user_allowed_by_id', function( $allowed, $category_id ) {
    return $allowed;
}, 10, 2 );

document_library_pro_document_visibility_current_user_allowed_by_id

Filters the document visibility current user allowed by id value.

Arguments

  • $allowed (bool): The allowed value supplied to this hook.
  • $document_id (int): The document id value supplied to this hook.

Return

bool: The filtered $allowed value.

add_filter( 'document_library_pro_document_visibility_current_user_allowed_by_id', function( $allowed, $document_id ) {
    return $allowed;
}, 10, 2 );

document_library_pro_document_visibility_current_user_allowed_by_document_owner_id

Filters the document visibility current user allowed by document owner id value.

Arguments

  • $allowed (bool): The allowed value supplied to this hook.
  • $document_id (int): The document id value supplied to this hook.

Return

bool: The filtered $allowed value.

add_filter( 'document_library_pro_document_visibility_current_user_allowed_by_document_owner_id', function( $allowed, $document_id ) {
    return $allowed;
}, 10, 2 );

document_library_pro_global_current_user_allowed_by_role

Filters the global current user allowed by role value.

Arguments

  • $allowed (bool): The allowed value supplied to this hook.

Return

bool: The filtered $allowed value.

add_filter( 'document_library_pro_global_current_user_allowed_by_role', function( $allowed ) {
    return $allowed;
}, 10, 1 );

document_library_pro_global_current_user_allowed_by_id

Filters the global current user allowed by id value.

Arguments

  • $allowed (bool): The allowed value supplied to this hook.

Return

bool: The filtered $allowed value.

add_filter( 'document_library_pro_global_current_user_allowed_by_id', function( $allowed ) {
    return $allowed;
}, 10, 1 );

document_library_pro_should_bail_get_terms_args

Controls whether access-control filtering should leave a get_terms() query unchanged.

Arguments

  • $bail (mixed): The bail value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $taxonomies (array): The taxonomies value supplied to this hook.
  • $protector (mixed): The protector value supplied to this hook.

Return

mixed: The filtered $bail value.

add_filter( 'document_library_pro_should_bail_get_terms_args', function( $bail, $args, $taxonomies, $protector ) {
    return $bail;
}, 10, 4 );

document_library_pro_template_spoofed_post

Filters the temporary post object used when protected content is replaced by a login or 404 template.

Arguments

  • $post (WP_Post): The post value supplied to this hook.

Return

WP_Post: The filtered $post value.

add_filter( 'document_library_pro_template_spoofed_post', function( $post ) {
    return $post;
} );

document_library_pro_disable_taxonomy_libraries

Controls whether automatic document libraries on taxonomy archive pages are disabled.

Arguments

  • $disabled (bool): The disabled value supplied to this hook.

Return

bool: The filtered $disabled value.

add_filter( 'document_library_pro_disable_taxonomy_libraries', '__return_true' );

File-content indexing

document_library_pro_file_content_parsers

Filters parser instances keyed by the file types they support.

Arguments

  • $parsers (array): The parsers value supplied to this hook.

Return

array: The filtered $parsers value.

add_filter( 'document_library_pro_file_content_parsers', function( $parsers ) {
    return $parsers;
} );

document_library_pro_file_content_extension_mime_map

Filters the extension-to-MIME map used to select a file-content parser.

Arguments

  • $map (array): The map value supplied to this hook.

Return

array: The filtered $map value.

add_filter( 'document_library_pro_file_content_extension_mime_map', function( $map ) {
    return $map;
} );

document_library_pro_file_content_batch_size

Filters the safe file-content processing batch size. The requested batch size is the second argument.

Arguments

  • $safe_size (int): The safe size value supplied to this hook.
  • $requested_size (int): The requested size value supplied to this hook.

Return

int: The filtered $safe_size value.

add_filter( 'document_library_pro_file_content_batch_size', function( $safe_size, $requested_size ) {
    return min( $safe_size, 5 );
}, 10, 2 );

document_library_pro_file_content_fast_cache_validation

Controls whether file-content cache validation uses the fast path. It receives the document and attachment IDs.

Arguments

  • $fast (mixed): The fast value supplied to this hook.
  • $post_id (int): The post id value supplied to this hook.
  • $attachment_id (int): The attachment id value supplied to this hook.

Return

mixed: The filtered $fast value.

add_filter( 'document_library_pro_file_content_fast_cache_validation', function( $fast, $post_id, $attachment_id ) {
    return $fast;
}, 10, 3 );

document_library_pro_file_content_max_file_size

Filters the maximum file size, in bytes, that may be parsed. A value of 0 means no plugin limit.

Arguments

  • $bytes (mixed): The bytes value supplied to this hook.
  • $post_id (int): The post id value supplied to this hook.
  • $attachment_id (int): The attachment id value supplied to this hook.

Return

mixed: The filtered $bytes value.

add_filter( 'document_library_pro_file_content_max_file_size', function( $bytes, $post_id, $attachment_id ) {
    return 20 * MB_IN_BYTES;
}, 10, 3 );

document_library_pro_file_content_max_content_bytes

Filters the maximum number of extracted content bytes retained for one document. A value of 0 means no plugin limit.

Arguments

  • $bytes (mixed): The bytes value supplied to this hook.
  • $post_id (int): The post id value supplied to this hook.
  • $attachment_id (int): The attachment id value supplied to this hook.

Return

mixed: The filtered $bytes value.

add_filter( 'document_library_pro_file_content_max_content_bytes', function( $bytes, $post_id, $attachment_id ) {
    return 2 * MB_IN_BYTES;
}, 10, 3 );

DataViews indexing

document_library_pro_searchable_attributes

Filters the attributes and content included in a post's search index.

Arguments

  • $attributes (array): The attributes value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

array: The filtered $attributes value.

add_filter( 'document_library_pro_searchable_attributes', function( $attributes, $post ) {
    return $attributes;
}, 10, 2 );

document_library_pro_index_attribute_<attribute>

Filters the content of one attribute before it is added to the search index.

Arguments

  • $content (string): The content value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $attribute (mixed): The attribute value supplied to this hook.

Return

string: The filtered $content value.

add_filter( 'document_library_pro_index_attribute_title', function( $content, $post, $attribute ) {
    return $content;
}, 10, 3 );

document_library_pro_attribute_weights

Filters the relevance weight assigned to each indexed search attribute. Higher numbers have more influence on relevance. Wildcard keys such as cf:* and tax:* apply to all indexed custom fields and custom taxonomies.

Arguments

  • $weights (array): Attribute names or wildcard patterns mapped to integer weights.
  • $plugin_prefix (string): The DataViews plugin prefix. This argument is supplied by the main DataViews query; it is omitted by the standalone indexed-search helper, so declare it optional.

Return

array: The complete filtered attribute-to-weight map.

add_filter( 'document_library_pro_attribute_weights', function( $weights, $plugin_prefix = '' ) {
    // These are the current default relevance weights.
    $weights = [
        'title'      => 100,
        'content'    => 80,
        'excerpt'    => 70,
        'author'     => 50,
        'cf:*'       => 40,
        'tax:*'      => 30,
        'categories' => 30,
        'tags'       => 30,
    ];

    // Adjust individual values here if required.
    // $weights['title'] = 120;

    return $weights;
}, 10, 2 );

document_library_pro_index_scope_args

Filters the index scope args value.

Arguments

  • $scope_args (array): The current indexing scope arguments.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered indexing scope arguments.

add_filter( 'document_library_pro_index_scope_args', function( $scope_args, $args ) {
    return $scope_args;
}, 10, 2 );

document_library_pro_is_post_indexable

Filters the is post indexable value.

Arguments

  • $indexable (bool): The indexable value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

bool: The filtered $indexable value.

add_filter( 'document_library_pro_is_post_indexable', function( $indexable, $post ) {
    return $indexable;
}, 10, 2 );

document_library_pro_indexing_post_meta_blocklist

Filters the indexing post meta blocklist value.

Arguments

  • $blocklist (array): The blocklist value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

array: The filtered $blocklist value.

add_filter( 'document_library_pro_indexing_post_meta_blocklist', function( $blocklist, $plugin_prefix ) {
    return $blocklist;
}, 10, 2 );

document_library_pro_filter_index_meta_keys

Filters the filter index meta keys value.

Arguments

  • $keys (array): The keys value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

array: The filtered $keys value.

add_filter( 'document_library_pro_filter_index_meta_keys', function( $keys, $plugin_prefix ) {
    return $keys;
}, 10, 2 );

document_library_pro_filter_index_taxonomies

Filters the filter index taxonomies value.

Arguments

  • $taxonomies (array): The taxonomies value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $indexer (object): The indexer value supplied to this hook.

Return

array: The filtered $taxonomies value.

add_filter( 'document_library_pro_filter_index_taxonomies', function( $taxonomies, $post, $indexer ) {
    return $taxonomies;
}, 10, 3 );

document_library_pro_taxonomy_filter_data

Filters the taxonomy filter data value.

Arguments

  • $data (array): The data value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $taxonomy (string): The taxonomy value supplied to this hook.
  • $term (object): The term value supplied to this hook.

Return

array: The filtered $data value.

add_filter( 'document_library_pro_taxonomy_filter_data', function( $data, $post, $taxonomy, $term ) {
    return $data;
}, 10, 4 );

document_library_pro_meta_filter_data

Filters the meta filter data value.

Arguments

  • $data (array): The data value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $meta_key (string): The meta key value supplied to this hook.
  • $value (string): The value value supplied to this hook.

Return

array: The filtered $data value.

add_filter( 'document_library_pro_meta_filter_data', function( $data, $post, $meta_key, $value ) {
    return $data;
}, 10, 4 );

document_library_pro_sort_index_ids

Filters the sort index ids value.

Arguments

  • $sort_ids (int): The sort ids value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

int: The filtered $sort_ids value.

add_filter( 'document_library_pro_sort_index_ids', function( $sort_ids, $plugin_prefix ) {
    return $sort_ids;
}, 10, 2 );

document_library_pro_sort_index_value

Filters the sort index value value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $sort_id (int): The sort id value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $indexer (object): The indexer value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_sort_index_value', function( $value, $sort_id, $post, $indexer, $plugin_prefix ) {
    return $value;
}, 10, 5 );

document_library_pro_sort_index_value_<sort_id>

Filters the sort index value <sort id> value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $indexer (object): The indexer value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_sort_index_value_sort_id', function( $value, $post, $indexer, $plugin_prefix ) {
    return $value;
}, 10, 4 );

document_library_pro_batch_size

Filters the batch size value.

Arguments

  • $batch_size (int): The batch size value supplied to this hook.

Return

int: The filtered $batch_size value.

add_filter( 'document_library_pro_batch_size', function( $batch_size ) {
    return $batch_size;
}, 10, 1 );

document_library_pro_batch_time_limit

Filters the batch time limit value.

Arguments

  • $time_limit (int): The time limit value supplied to this hook.

Return

int: The filtered $time_limit value.

add_filter( 'document_library_pro_batch_time_limit', function( $time_limit ) {
    return $time_limit;
}, 10, 1 );

document_library_pro_memory_threshold

Filters the memory threshold value.

Arguments

  • $threshold (int): The threshold value supplied to this hook.

Return

int: The filtered $threshold value.

add_filter( 'document_library_pro_memory_threshold', function( $threshold ) {
    return $threshold;
}, 10, 1 );

document_library_pro_max_index_attempts

Filters the max index attempts value.

Arguments

  • $attempts (int): The attempts value supplied to this hook.

Return

int: The filtered $attempts value.

add_filter( 'document_library_pro_max_index_attempts', function( $attempts ) {
    return $attempts;
}, 10, 1 );

document_library_pro_index_recovery_cooldown

Filters the index recovery cooldown value.

Arguments

  • $cooldown (int): The cooldown value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

int: The filtered $cooldown value.

add_filter( 'document_library_pro_index_recovery_cooldown', function( $cooldown, $plugin_prefix ) {
    return $cooldown;
}, 10, 2 );

document_library_pro_search_min_token_length

Filters the search min token length value.

Arguments

  • $length (int): The length value supplied to this hook.

Return

int: The filtered $length value.

add_filter( 'document_library_pro_search_min_token_length', function( $length ) {
    return $length;
}, 10, 1 );

document_library_pro_search_max_token_length

Filters the search max token length value.

Arguments

  • $length (int): The length value supplied to this hook.

Return

int: The filtered $length value.

add_filter( 'document_library_pro_search_max_token_length', function( $length ) {
    return $length;
}, 10, 1 );

document_library_pro_search_content_threshold

Filters the search content threshold value.

Arguments

  • $threshold (int): The threshold value supplied to this hook.

Return

int: The filtered $threshold value.

add_filter( 'document_library_pro_search_content_threshold', function( $threshold ) {
    return $threshold;
}, 10, 1 );

document_library_pro_search_stopwords

Filters the search stopwords value.

Arguments

  • $stopwords (array): The stopwords value supplied to this hook.

Return

array: The filtered $stopwords value.

add_filter( 'document_library_pro_search_stopwords', function( $stopwords ) {
    return $stopwords;
}, 10, 1 );

document_library_pro_search_strict_matching

Filters the search strict matching value.

Arguments

  • $strict (bool): The strict value supplied to this hook.

Return

bool: The filtered $strict value.

add_filter( 'document_library_pro_search_strict_matching', function( $strict ) {
    return $strict;
}, 10, 1 );

document_library_pro_search_parsed_tokens

Filters the search parsed tokens value.

Arguments

  • $tokens (array): The tokens value supplied to this hook.
  • $content (string): The content value supplied to this hook.

Return

array: The filtered $tokens value.

add_filter( 'document_library_pro_search_parsed_tokens', function( $tokens, $content ) {
    return $tokens;
}, 10, 2 );

document_library_pro_search_prepared_content

Filters the search prepared content value.

Arguments

  • $content (string): The content value supplied to this hook.

Return

string: The filtered $content value.

add_filter( 'document_library_pro_search_prepared_content', function( $content ) {
    return $content;
}, 10, 1 );

document_library_pro_search_special_token_patterns

Filters the search special token patterns value.

Arguments

  • $patterns (array): The patterns value supplied to this hook.
  • $content (string): The content value supplied to this hook.

Return

array: The filtered $patterns value.

add_filter( 'document_library_pro_search_special_token_patterns', function( $patterns, $content ) {
    return $patterns;
}, 10, 2 );

Library arguments and configuration (continued)

document_library_pro_args_custom_object_properties

Filters the list of custom argument names that can be read as properties of the view arguments object.

Arguments

  • $properties (mixed): The properties value supplied to this hook.

Return

mixed: The filtered $properties value.

add_filter( 'document_library_pro_args_custom_object_properties', function( $properties ) {
    $properties[] = 'my_custom_arg';
    return $properties;
} );

document_library_pro_parse_filters

Filters parsed library filters after they have been normalized.

Arguments

  • $parsed (mixed): The parsed value supplied to this hook.
  • $raw_filters (array): The raw filters value supplied to this hook.
  • $columns (array): The columns value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

mixed: The filtered $parsed value.

add_filter( 'document_library_pro_parse_filters', function( $parsed, $raw_filters, $columns, $args ) {
    return $parsed;
}, 10, 4 );

document_library_pro_data_config

Filters the inline legacy table configuration. This filter is legacy-only. The following example disables column sorting in legacy tables.

Arguments

  • $config (array): The config value supplied to this hook.
  • $table_args (object): The current library arguments object.

Return

array: The filtered $config value.

add_filter( 'document_library_pro_data_config', function( $config, $table_args ) {
    $config['ordering'] = false;
    return $config;
}, 10, 2 );

document_library_pro_dataviews_config

Filters the DataViews frontend configuration before it is returned to the browser. It controls columns, filters, features, initial state, pagination, URL syncing and endpoint details. This filter is DataViews-only.

Arguments

  • $config (array): The config value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered $config value.

add_filter( 'document_library_pro_dataviews_config', function( $config, $args ) {
    $config['features']['search'] = false;
    return $config;
}, 10, 2 );

document_library_pro_datatables_config

Filters the DataTables compatibility configuration generated by the DataViews engine. This affects only the legacy DataTables frontend.

Arguments

  • $config (array): The config value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered $config value.

add_filter( 'document_library_pro_datatables_config', function( $config, $args ) {
    return $config;
}, 10, 2 );

document_library_pro_prefetch_adjacent_pages

Filters whether the DataViews frontend prefetches adjacent pages. The default is true.

Arguments

  • $prefetch (bool): The prefetch value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

bool: The filtered $prefetch value.

add_filter( 'document_library_pro_prefetch_adjacent_pages', '__return_false' );

document_library_pro_responsive_breakpoints

Filters the responsive breakpoint map passed to DataViews.

Arguments

  • $breakpoints (mixed): The breakpoints value supplied to this hook.

Return

mixed: The filtered $breakpoints value.

add_filter( 'document_library_pro_responsive_breakpoints', function( $breakpoints ) {
    $breakpoints['tablet'] = 900;
    return $breakpoints;
} );

document_library_pro_shortcode_output

Filters the HTML returned by the [doc_library] shortcode. The current hook receives the HTML as its only argument.

Arguments

  • $html (string): The html value supplied to this hook.

Return

string: The filtered $html value.

add_filter( 'document_library_pro_shortcode_output', function( $html ) {
    return '<div class="my-library">' . $html . '</div>';
} );

Filters whether the document library shortcode runs inside WordPress search result excerpts. The default is false.

Arguments

  • $value (string): The value value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_run_in_search', '__return_true' );

Search, filtering and query behavior

document_library_pro_search_filter_get_terms_args

Filters the arguments passed to get_terms() when building dropdown filters.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $taxonomy (string): The taxonomy value supplied to this hook.
  • $table_args (object): The current library arguments object.

Return

array: The filtered $args value.

add_filter( 'document_library_pro_search_filter_get_terms_args', function( $args, $taxonomy, $table_args ) {
    $args['orderby'] = 'name';
    return $args;
}, 10, 3 );

document_library_pro_search_filter_terms

Filters the terms for every taxonomy dropdown.

Arguments

  • $terms (array): The terms value supplied to this hook.
  • $taxonomy (string): The taxonomy value supplied to this hook.
  • $table_args (object): The current library arguments object.

Return

array: The filtered $terms value.

add_filter( 'document_library_pro_search_filter_terms', function( $terms, $taxonomy, $table_args ) {
    return $terms;
}, 10, 3 );

document_library_pro_search_filter_terms_<taxonomy>

Filters the terms for one dropdown. Replace <taxonomy> with the taxonomy slug, for example doc_categories, doc_tags, doc_author, file_type, or a custom taxonomy slug.

Arguments

  • $terms (array): The terms value supplied to this hook.
  • $table_args (object): The current library arguments object.

Return

array: The filtered $terms value.

add_filter( 'document_library_pro_search_filter_terms_doc_categories', function( $terms, $table_args ) {
    return array_filter( $terms, function( $term ) {
        return 'private' !== $term->slug;
    } );
}, 10, 2 );

document_library_pro_search_filter_heading_<column>

Filters the heading for an individual dropdown filter. Replace <column> with the normalized column name.

Arguments

  • $heading (string): The heading value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

string: The filtered $heading value.

add_filter( 'document_library_pro_search_filter_heading_doc_categories', function( $heading, $args ) {
    return 'Choose a category';
}, 10, 2 );

document_library_pro_scope_search_filter_terms

Controls whether dropdown terms are restricted to documents matching the current library query. The default is true. This filter is DataViews-only.

Arguments

  • $scope (bool): The scope value supplied to this hook.
  • $taxonomy (string): The taxonomy value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $term_args (array): The term args value supplied to this hook.
  • $builder (object): The builder value supplied to this hook.

Return

bool: The filtered $scope value.

add_filter( 'document_library_pro_scope_search_filter_terms', function( $scope, $taxonomy, $args, $term_args, $builder ) {
    return 'doc_categories' === $taxonomy ? false : $scope;
}, 10, 5 );

document_library_pro_data_filters

Filters all dropdown search filters at once. The filters are keyed by column.

Arguments

  • $filters (array): The filters value supplied to this hook.
  • $table_args (object): The current library arguments object.

Return

array: The filtered $filters value.

add_filter( 'document_library_pro_data_filters', function( $filters, $table_args ) {
    $filters['doc_categories']['heading'] = 'Choose a category';
    return $filters;
}, 10, 2 );

document_library_pro_filterable_columns

Filters the column names which may be used as library filters.

Arguments

  • $columns (array): The columns value supplied to this hook.

Return

array: The filtered $columns value.

add_filter( 'document_library_pro_filterable_columns', function( $columns ) {
    $columns[] = 'tax:department';
    return $columns;
} );

document_library_pro_auto_filter_counts

Controls whether filter counts are calculated for the DataViews response.

Arguments

  • $include (mixed): The include value supplied to this hook.
  • $filter_ids (int): The filter ids value supplied to this hook.
  • $view (object): The view value supplied to this hook.

Return

mixed: The filtered $include value.

add_filter( 'document_library_pro_auto_filter_counts', function( $include, $filter_ids, $view ) {
    return count( $filter_ids ) <= 5 ? $include : false;
}, 10, 3 );

document_library_pro_filter_counts

Filters the calculated DataViews filter counts.

Arguments

  • $counts (int): The counts value supplied to this hook.
  • $filter_ids (int): The filter ids value supplied to this hook.
  • $view (object): The view value supplied to this hook.

Return

int: The filtered $counts value.

add_filter( 'document_library_pro_filter_counts', function( $counts, $filter_ids, $view ) {
    return $counts;
}, 10, 3 );

document_library_pro_folder_orderby

Filters the orderby value used when querying folders.

Arguments

  • $orderby (string): The orderby value supplied to this hook.

Return

string: The filtered $orderby value.

add_filter( 'document_library_pro_folder_orderby', function( $orderby ) {
    return 'term_order';
} );

document_library_pro_folder_categories

Filters the category terms used to build the folder tree.

Arguments

  • $categories (mixed): The categories value supplied to this hook.

Return

mixed: The filtered $categories value.

add_filter( 'document_library_pro_folder_categories', function( $categories ) {
    return $categories;
} );

document_library_pro_should_display_category_description_in_folder

Controls whether category descriptions are displayed in folder mode. The default is false.

Arguments

  • $value (string): The value value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_should_display_category_description_in_folder', '__return_true' );

document_library_pro_folders_script_params

Filters the parameters passed to the folder-view JavaScript.

Arguments

  • $params (mixed): The params value supplied to this hook.

Return

mixed: The filtered $params value.

add_filter( 'document_library_pro_folders_script_params', function( $params ) {
    return $params;
} );

document_library_pro_query_args

Filters arguments passed to WP_Query. On the DataViews indexed path, supported changes are translated to the indexed query; unsupported changes cause that request to use the WordPress query fallback.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $query (object): The query value supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'document_library_pro_query_args', function( $args, $query ) {
    $args['post_parent'] = 0;
    return $args;
}, 10, 2 );

document_library_pro_base_query_args

Filters the base WP_Query arguments before selection, taxonomy and custom-field clauses are added.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $query (object): The query value supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'document_library_pro_base_query_args', function( $args, $query ) {
    return $args;
}, 10, 2 );

document_library_pro_tax_query

Filters the generated WordPress taxonomy query.

Arguments

  • $tax_query (object): The tax query value supplied to this hook.
  • $query (object): The query value supplied to this hook.

Return

object: The filtered $tax_query value.

add_filter( 'document_library_pro_tax_query', function( $tax_query, $query ) {
    return $tax_query;
}, 10, 2 );

document_library_pro_meta_query

Filters the generated WordPress meta query.

Arguments

  • $meta_query (object): The meta query value supplied to this hook.
  • $query (object): The query value supplied to this hook.

Return

object: The filtered $meta_query value.

add_filter( 'document_library_pro_meta_query', function( $meta_query, $query ) {
    return $meta_query;
}, 10, 2 );

document_library_pro_optimize_table_query

Controls legacy WP_Query optimizations. Return false if custom code needs database fields which the library would otherwise omit.

Arguments

  • $optimize (bool): The optimize value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

bool: The filtered $optimize value.

add_filter( 'document_library_pro_optimize_table_query', '__return_false' );

document_library_pro_global_search_custom_args

Filters the library arguments used by the global document search handler.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'document_library_pro_global_search_custom_args', function( $args ) {
    $args['rows_per_page'] = 20;
    return $args;
} );

Controls whether DataViews uses its indexed query/search path when available. Return false to force the WordPress query fallback.

Arguments

  • $use_indexed (bool): The use indexed value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $context (string): The context value supplied to this hook.

Return

bool: The filtered $use_indexed value.

add_filter( 'document_library_pro_use_indexed_search', function( $use_indexed, $query, $context ) {
    return $use_indexed;
}, 10, 3 );

document_library_pro_search_results

Filters search results before they are cached on the DataViews query object.

Arguments

  • $posts (array): The posts value supplied to this hook.
  • $search_term (object): The search term value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

array: The filtered $posts value.

add_filter( 'document_library_pro_search_results', function( $posts, $search_term, $query, $plugin_prefix ) {
    return $posts;
}, 10, 4 );

document_library_pro_query_results

Filters the final hydrated WP_Post objects returned by the indexed query path.

Arguments

  • $posts (array): The posts value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

array: The filtered $posts value.

add_filter( 'document_library_pro_query_results', function( $posts, $query, $plugin_prefix ) {
    return $posts;
}, 10, 3 );

document_library_pro_search_sql

Filters the complete search SQL used by the DataViews query. This is an advanced hook for trusted code; prepare any variable values with $wpdb->prepare().

Arguments

  • $sql (string): The sql value supplied to this hook.
  • $search_term (object): The search term value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

string: The filtered $sql value.

add_filter( 'document_library_pro_search_sql', function( $sql, $search_term, $query, $plugin_prefix ) {
    return $sql;
}, 10, 4 );

document_library_pro_filter_sql

Filters the filter-only SQL used when indexed filtering is active without a search term.

Arguments

  • $sql (string): The sql value supplied to this hook.
  • $conditions (array): The conditions value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

string: The filtered $sql value.

add_filter( 'document_library_pro_filter_sql', function( $sql, $conditions, $query, $plugin_prefix ) {
    return $sql;
}, 10, 4 );

document_library_pro_query_conditions

Filters indexed query condition fragments. Added fragments must start with AND.

Arguments

  • $conditions (array): The conditions value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

array: The filtered $conditions value.

add_filter( 'document_library_pro_query_conditions', function( $conditions, $query, $plugin_prefix ) {
    $conditions[] = ' AND p.post_password = ""';
    return $conditions;
}, 10, 3 );

document_library_pro_indexed_where_clause

Adds a SQL WHERE fragment to indexed queries. The posts table uses the alias p and the returned fragment must start with AND.

Arguments

  • $clause (string): The clause value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

string: The filtered $clause value.

add_filter( 'document_library_pro_indexed_where_clause', function( $clause, $query, $plugin_prefix ) {
    return $clause . ' AND p.post_password = ""';
}, 10, 3 );

document_library_pro_query_constraints

Filters the structured constraints applied to indexed queries.

Arguments

  • $constraints (mixed): The constraints value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

mixed: The filtered $constraints value.

add_filter( 'document_library_pro_query_constraints', function( $constraints, $query, $plugin_prefix ) {
    return $constraints;
}, 10, 3 );

document_library_pro_sort_join_clause

Adds a SQL JOIN fragment for a custom indexed sort column.

Arguments

  • $join (mixed): The join value supplied to this hook.
  • $sort_by (mixed): The sort by value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

mixed: The filtered $join value.

add_filter( 'document_library_pro_sort_join_clause', function( $join, $sort_by, $query, $plugin_prefix ) {
    return $join;
}, 10, 4 );

document_library_pro_sort_order_clause

Filters the SQL sorting expression for custom indexed sort columns. Return the expression without the ORDER BY keyword.

Arguments

  • $order_by (mixed): The order by value supplied to this hook.
  • $sort_by (mixed): The sort by value supplied to this hook.
  • $order (mixed): The order value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

mixed: The filtered $order_by value.

add_filter( 'document_library_pro_sort_order_clause', function( $order_by, $sort_by, $order, $query, $plugin_prefix ) {
    return $order_by;
}, 10, 5 );

document_library_pro_indexed_orderby_supported

Filters whether a custom sort identifier can be handled by the indexed query path.

Arguments

  • $supported (mixed): The supported value supplied to this hook.
  • $sort_id (int): The sort id value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

mixed: The filtered $supported value.

add_filter( 'document_library_pro_indexed_orderby_supported', function( $supported, $sort_id, $query, $plugin_prefix ) {
    return 'priority' === $sort_id ? true : $supported;
}, 10, 4 );

document_library_pro_indexed_search_sql

Filters SQL generated by the standalone indexed search helper.

Arguments

  • $sql (string): The sql value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

string: The filtered $sql value.

add_filter( 'document_library_pro_indexed_search_sql', function( $sql, $query, $args ) {
    return $sql;
}, 10, 3 );

document_library_pro_indexed_search_results

Filters results returned by the standalone indexed search helper.

Arguments

  • $results (mixed): The results value supplied to this hook.
  • $query (object): The query value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

mixed: The filtered $results value.

add_filter( 'document_library_pro_indexed_search_results', function( $results, $query, $args ) {
    return $results;
}, 10, 3 );

Library output and column formatting

document_library_pro_data_id

Filters the id column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_id', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_title

Filters the title column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $title_link (string): The title link value supplied to this hook.
  • $new_tab (bool): The new tab value supplied to this hook.
  • $links (array): The links value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_title', function( $value, $post, $title_link, $new_tab, $links ) {
    return $value;
}, 10, 5 );

document_library_pro_data_document_title

Filters the document title column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $title_link (string): The title link value supplied to this hook.
  • $new_tab (bool): The new tab value supplied to this hook.
  • $links (array): The links value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_document_title', function( $value, $post, $title_link, $new_tab, $links ) {
    return $value;
}, 10, 5 );

document_library_pro_data_categories

Filters the categories column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_categories', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_doc_categories

Filters the doc categories column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_doc_categories', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_tags

Filters the tags column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_tags', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_doc_tags

Filters the doc tags column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_doc_tags', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_doc_author

Filters the doc author column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_doc_author', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_author

Filters the author column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_author', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_file_type

Filters the file type column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_file_type', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_file_size

Filters the file size column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_file_size', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_filename

Filters the filename column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $filename_link (string): The filename link value supplied to this hook.
  • $new_tab (bool): The new tab value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_filename', function( $value, $post, $filename_link, $new_tab ) {
    return $value;
}, 10, 4 );

document_library_pro_data_download_count

Filters the download count column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_download_count', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_date

Filters the date column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_date', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_date_modified

Filters the date modified column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_date_modified', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_image

Filters the image column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_image', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_content

Filters the content column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_content', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_excerpt

Filters the excerpt column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_excerpt', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_status

Filters the status column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_status', function( $value, $post ) {
    return $value;
}, 10, 2 );

Filters the link column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_link', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_button

Filters the button column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_button', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_version

Filters the version column value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_version', function( $value, $post ) {
    return $value;
}, 10, 2 );

Filters the id value before its link is added.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_id_before_link', function( $value, $post ) {
    return $value;
}, 10, 2 );

Filters the title value before its link is added.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_title_before_link', function( $value, $post ) {
    return $value;
}, 10, 2 );

Filters the image value before its link is added.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_image_before_link', function( $value, $post ) {
    return $value;
}, 10, 2 );

document_library_pro_data_categories_structured

Filters structured categories data.

Arguments

  • $data (array): The data value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

array: The filtered $data value.

add_filter( 'document_library_pro_data_categories_structured', function( $data, $post ) {
    return $data;
}, 10, 2 );

document_library_pro_data_tags_structured

Filters structured tags data.

Arguments

  • $data (array): The data value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

array: The filtered $data value.

add_filter( 'document_library_pro_data_tags_structured', function( $data, $post ) {
    return $data;
}, 10, 2 );

document_library_pro_data_image_structured

Filters structured image data.

Arguments

  • $data (array): The data value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

array: The filtered $data value.

add_filter( 'document_library_pro_data_image_structured', function( $data, $post ) {
    return $data;
}, 10, 2 );

document_library_pro_data_combined_column

Filters the value generated for a combined DataViews column.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $columns (array): The columns value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_combined_column', function( $value, $post, $columns, $args ) {
    return $value;
}, 10, 4 );

document_library_pro_data_hidden_filter

Filters the hidden filter data generated for a post.

Arguments

  • $value (string): The value value supplied to this hook.
  • $filter_column (mixed): The filter column value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_hidden_filter', function( $value, $filter_column, $post ) {
    return $value;
}, 10, 3 );

document_library_pro_data_column_terms

Filters the raw terms before a taxonomy column is formatted.

Arguments

  • $terms (array): The terms value supplied to this hook.
  • $column (mixed): The column value supplied to this hook.

Return

array: The filtered $terms value.

add_filter( 'document_library_pro_data_column_terms', function( $terms, $column ) {
    return $terms;
}, 10, 2 );

document_library_pro_data_custom_taxonomy

Filters all custom taxonomy column values. It receives the formatted terms, taxonomy slug and post.

Arguments

  • $terms (array): The terms value supplied to this hook.
  • $taxonomy (string): The taxonomy value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

array: The filtered $terms value.

add_filter( 'document_library_pro_data_custom_taxonomy', function( $terms, $taxonomy, $post ) {
    return $terms;
}, 10, 3 );

document_library_pro_data_custom_taxonomy_<taxonomy>

Filters the formatted value for one custom taxonomy column.

Arguments

  • $terms (array): The terms value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

array: The filtered $terms value.

add_filter( 'document_library_pro_data_custom_taxonomy_sector', function( $terms, $post ) {
    return $terms;
}, 10, 2 );

document_library_pro_data_custom_taxonomy_structured

Filters all structured custom taxonomy values. It receives the structured data, taxonomy slug and post.

Arguments

  • $data (array): The data value supplied to this hook.
  • $taxonomy (string): The taxonomy value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

array: The filtered $data value.

add_filter( 'document_library_pro_data_custom_taxonomy_structured', function( $data, $taxonomy, $post ) {
    return $data;
}, 10, 3 );

document_library_pro_data_custom_taxonomy_structured_<taxonomy>

Filters structured values for one custom taxonomy.

Arguments

  • $data (array): The data value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

array: The filtered $data value.

add_filter( 'document_library_pro_data_custom_taxonomy_structured_sector', function( $data, $post ) {
    return $data;
}, 10, 2 );

document_library_pro_data_custom_field

Filters all custom field values. It receives the formatted value, field name and post.

Arguments

  • $value (string): The value value supplied to this hook.
  • $field (string): The field value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_custom_field', function( $value, $field, $post ) {
    return $value;
}, 10, 3 );

document_library_pro_data_custom_field_<field>

Filters one custom field value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_data_custom_field_extra_notes', function( $value, $post ) {
    return $value;
}, 10, 2 );

Filters the destination URL for a URL-valued custom field.

Arguments

  • $url (string): The url value supplied to this hook.
  • $field (string): The field value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $url value.

add_filter( 'document_library_pro_url_custom_field_link', function( $url, $field, $post ) {
    return $url;
}, 10, 3 );

document_library_pro_url_custom_field_text

Filters the link text for a URL-valued custom field.

Arguments

  • $text (string): The text value supplied to this hook.
  • $field (string): The field value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $text value.

add_filter( 'document_library_pro_url_custom_field_text', function( $text, $field, $post ) {
    return $text;
}, 10, 3 );

document_library_pro_custom_field_stored_date_format

Specifies the stored date format for an individual custom field.

Arguments

  • $format (object): The format value supplied to this hook.
  • $field (string): The field value supplied to this hook.

Return

object: The filtered $format value.

add_filter( 'document_library_pro_custom_field_stored_date_format', function( $format, $field ) {
    return 'despatch_date' === $field ? 'd/m/Y' : $format;
}, 10, 2 );

document_library_pro_custom_field_is_eu_au_date

Filters whether a custom field should be interpreted as a day-first date.

Arguments

  • $is_eu_date (mixed): The is eu date value supplied to this hook.
  • $field (string): The field value supplied to this hook.

Return

mixed: The filtered $is_eu_date value.

add_filter( 'document_library_pro_custom_field_is_eu_au_date', function( $is_eu_date, $field ) {
    return 'event_date' === $field ? true : $is_eu_date;
}, 10, 2 );

document_library_pro_taxonomy_is_eu_au_date

Filters whether a custom taxonomy value should be interpreted as a day-first date.

Arguments

  • $is_eu_date (mixed): The is eu date value supplied to this hook.
  • $taxonomy (string): The taxonomy value supplied to this hook.

Return

mixed: The filtered $is_eu_date value.

add_filter( 'document_library_pro_taxonomy_is_eu_au_date', function( $is_eu_date, $taxonomy ) {
    return 'event_date' === $taxonomy ? true : $is_eu_date;
}, 10, 2 );

document_library_pro_acf_value

Filters a value returned from Advanced Custom Fields. It receives the value, ACF field object and post ID.

Arguments

  • $value (string): The value value supplied to this hook.
  • $field (string): The field value supplied to this hook.
  • $post_id (int): The post id value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_acf_value', function( $value, $field, $post_id ) {
    return $value;
}, 10, 3 );

document_library_pro_acf_sub_field_value

Filters an individual ACF repeater sub-field value.

Arguments

  • $value (string): The value value supplied to this hook.
  • $sub_field (string): The sub field value supplied to this hook.
  • $field (string): The field value supplied to this hook.
  • $post_id (int): The post id value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_acf_sub_field_value', function( $value, $sub_field, $field, $post_id ) {
    return $value;
}, 10, 4 );

document_library_pro_acf_repeater_field_value

Filters the completed array of formatted ACF repeater rows.

Arguments

  • $rows (mixed): The rows value supplied to this hook.

Return

mixed: The filtered $rows value.

add_filter( 'document_library_pro_acf_repeater_field_value', function( $rows ) {
    return $rows;
} );

document_library_pro_custom_table_data_<column>

Filters the table data object for a custom column. Return an object implementing the table-data contract, or false to keep the default behavior.

Arguments

  • $data (array): The data value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered $data value.

add_filter( 'document_library_pro_custom_table_data_reference', function( $data, $post, $args ) {
    return $data;
}, 10, 3 );

document_library_pro_table_data_object

Filters the final data object used for any column.

Arguments

  • $data_object (array): The data object value supplied to this hook.
  • $column (mixed): The column value supplied to this hook.
  • $entity (mixed): The entity value supplied to this hook.
  • $args (array|object): The arguments array or view-arguments object supplied to this hook.

Return

array: The filtered $data_object value.

add_filter( 'document_library_pro_table_data_object', function( $data_object, $column, $entity, $args ) {
    return $data_object;
}, 10, 4 );

document_library_pro_custom_data_<column>

Filters the scalar value returned for an otherwise unknown custom column.

Arguments

  • $value (string): The value value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

string: The filtered $value value.

add_filter( 'document_library_pro_custom_data_reference', function( $value, $post ) {
    return get_post_meta( $post->ID, 'reference', true );
}, 10, 2 );

document_library_pro_custom_data_atts_<column>

Filters the attributes returned with an otherwise unknown custom column.

Arguments

  • $attributes (array): The attributes value supplied to this hook.
  • $post (WP_Post): The post value supplied to this hook.

Return

array: The filtered $attributes value.

add_filter( 'document_library_pro_custom_data_atts_reference', function( $attributes, $post ) {
    return [ 'class' => 'reference-column' ];
}, 10, 2 );

REST API and DataViews services

document_library_pro_rest_permission_check

Filters the permission result for DataViews REST routes.

Arguments

  • $allowed (bool): The allowed value supplied to this hook.
  • $view (object): The view value supplied to this hook.
  • $request (object): The request value supplied to this hook.

Return

bool: The filtered $allowed value.

add_filter( 'document_library_pro_rest_permission_check', function( $allowed, $view, $request ) {
    return $allowed;
}, 10, 3 );

document_library_pro_rest_routes

Filters the route-controller objects registered by the DataViews REST server.

Arguments

  • $routes (array): The routes value supplied to this hook.
  • $namespace (string): The namespace value supplied to this hook.
  • $data_source (object): The registered DataViews data source.

Return

array: The filtered $routes value.

add_filter( 'document_library_pro_rest_routes', function( $routes, $namespace, $data_source ) {
    return $routes;
}, 10, 3 );

document_library_pro_rest_config_response

Filters the DataViews configuration REST response.

Arguments

  • $config (array): The config value supplied to this hook.
  • $view (object): The view value supplied to this hook.
  • $request (object): The request value supplied to this hook.

Return

array: The filtered $config value.

add_filter( 'document_library_pro_rest_config_response', function( $config, $view, $request ) {
    return $config;
}, 10, 3 );

document_library_pro_rest_data_response

Filters the DataViews rows, totals and filter counts returned by the data endpoint.

Arguments

  • $response (array): The response value supplied to this hook.
  • $view (object): The view value supplied to this hook.
  • $request (object): The request value supplied to this hook.

Return

array: The filtered $response value.

add_filter( 'document_library_pro_rest_data_response', function( $response, $view, $request ) {
    $response['generatedAt'] = current_time( 'mysql' );
    return $response;
}, 10, 3 );

document_library_pro_rest_map_request_args

Filters view arguments mapped from DataViews pagination, sorting, filter and search state.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $pagination (mixed): The pagination value supplied to this hook.
  • $sorting (mixed): The sorting value supplied to this hook.
  • $filters (array): The filters value supplied to this hook.
  • $search (mixed): The search value supplied to this hook.
  • $view (object): The view value supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'document_library_pro_rest_map_request_args', function( $args, $pagination, $sorting, $filters, $search, $view ) {
    $args['rows_per_page'] = min( 100, (int) $args['rows_per_page'] );
    return $args;
}, 10, 6 );

document_library_pro_rest_card_html

Filters the grid card HTML returned by a DataViews request.

Arguments

  • $html (string): The html value supplied to this hook.
  • $data (array): The data value supplied to this hook.
  • $view (object): The view value supplied to this hook.

Return

string: The filtered $html value.

add_filter( 'document_library_pro_rest_card_html', function( $html, $data, $view ) {
    return $html;
}, 10, 3 );

document_library_pro_rest_extra_request_data_keys

Filters the rest extra request data keys value.

Arguments

  • $keys (array): The keys value supplied to this hook.
  • $view (object): The view value supplied to this hook.
  • $request (object): The request value supplied to this hook.
  • $data_source (object): The registered DataViews data source.

Return

array: The filtered $keys value.

add_filter( 'document_library_pro_rest_extra_request_data_keys', function( $keys, $view, $request, $data_source ) {
    return $keys;
}, 10, 4 );

document_library_pro_rest_extra_request_data

Filters the rest extra request data value.

Arguments

  • $extra_data (array): The extra data value supplied to this hook.
  • $raw_data (array): The raw data value supplied to this hook.
  • $allowed_keys (array): The allowed extra request-data keys.
  • $view (object): The view value supplied to this hook.
  • $request (object): The request value supplied to this hook.
  • $data_source (object): The registered DataViews data source.

Return

array: The filtered $extra_data value.

add_filter( 'document_library_pro_rest_extra_request_data', function( $extra_data, $raw_data, $allowed_keys, $view, $request, $data_source ) {
    return $extra_data;
}, 10, 6 );

Diagnostics, installation and low-level filters

document_library_pro_create_page_id

Filters the result used when deciding whether a required plugin page already exists. The page slug and content are also passed.

Arguments

  • $page_id (int): The page id value supplied to this hook.
  • $slug (mixed): The slug value supplied to this hook.
  • $content (string): The content value supplied to this hook.

Return

int: The filtered $page_id value.

add_filter( 'document_library_pro_create_page_id', function( $page_id, $slug, $content ) {
    return $page_id;
}, 10, 3 );

document_library_pro_linkable_columns

Filters the library columns which may be turned into links.

Arguments

  • $columns (array): The columns value supplied to this hook.

Return

array: The filtered $columns value.

add_filter( 'document_library_pro_linkable_columns', function( $columns ) {
    return $columns;
} );

document_library_pro_installer_tables

Filters the database table definitions managed by the DataViews installer. The plugin prefix and installer configuration are also passed.

Arguments

  • $tables (array): The tables value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.
  • $config (array): The config value supplied to this hook.

Return

array: The filtered $tables value.

add_filter( 'document_library_pro_installer_tables', function( $tables, $plugin_prefix, $config ) {
    return $tables;
}, 10, 3 );

document_library_pro_site_health_fields

Filters the site health fields value.

Arguments

  • $fields (array): The fields value supplied to this hook.
  • $status (mixed): The status value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

array: The filtered $fields value.

add_filter( 'document_library_pro_site_health_fields', function( $fields, $status, $plugin_prefix ) {
    return $fields;
}, 10, 3 );

document_library_pro_site_health_plugin_name

Filters the site health plugin name value.

Arguments

  • $name (string): The name value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

string: The filtered $name value.

add_filter( 'document_library_pro_site_health_plugin_name', function( $name, $plugin_prefix ) {
    return $name;
}, 10, 2 );

document_library_pro_diagnostics_csv_batch_size

Filters the diagnostics csv batch size value.

Arguments

  • $batch_size (int): The batch size value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

int: The filtered $batch_size value.

add_filter( 'document_library_pro_diagnostics_csv_batch_size', function( $batch_size, $plugin_prefix ) {
    return $batch_size;
}, 10, 2 );

document_library_pro_diagnostics_csv_row_limit

Filters the diagnostics csv row limit value.

Arguments

  • $row_limit (int): The row limit value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

int: The filtered $row_limit value.

add_filter( 'document_library_pro_diagnostics_csv_row_limit', function( $row_limit, $plugin_prefix ) {
    return $row_limit;
}, 10, 2 );

document_library_pro_use_approximate_index_table_counts

Filters the use approximate index table counts value.

Arguments

  • $use_approximate (bool): The use approximate value supplied to this hook.
  • $table_name (string): The table name value supplied to this hook.
  • $statistic_key (string): The statistic key value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

bool: The filtered $use_approximate value.

add_filter( 'document_library_pro_use_approximate_index_table_counts', function( $use_approximate, $table_name, $statistic_key, $plugin_prefix ) {
    return $use_approximate;
}, 10, 4 );

document_library_pro_allow_exact_index_table_count_fallback

Filters the allow exact index table count fallback value.

Arguments

  • $allow (bool): The allow value supplied to this hook.
  • $table_name (string): The table name value supplied to this hook.
  • $statistic_key (string): The statistic key value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

bool: The filtered $allow value.

add_filter( 'document_library_pro_allow_exact_index_table_count_fallback', function( $allow, $table_name, $statistic_key, $plugin_prefix ) {
    return $allow;
}, 10, 4 );

document_library_pro_index_table_exact_count_threshold

Filters the index table exact count threshold value.

Arguments

  • $threshold (int): The threshold value supplied to this hook.
  • $table_name (string): The table name value supplied to this hook.
  • $statistic_key (string): The statistic key value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

int: The filtered $threshold value.

add_filter( 'document_library_pro_index_table_exact_count_threshold', function( $threshold, $table_name, $statistic_key, $plugin_prefix ) {
    return $threshold;
}, 10, 4 );

document_library_pro_index_table_count_cache_ttl

Filters the index table count cache ttl value.

Arguments

  • $ttl (int): The ttl value supplied to this hook.
  • $cache_key (object): The cache key value supplied to this hook.
  • $plugin_prefix (string): The plugin prefix value supplied to this hook.

Return

int: The filtered $ttl value.

add_filter( 'document_library_pro_index_table_count_cache_ttl', function( $ttl, $cache_key, $plugin_prefix ) {
    return $ttl;
}, 10, 3 );

Integrations

document_library_pro_facetwp_custom_args

Filters document library arguments generated by the FacetWP integration.

Arguments

  • $args (array|object): The arguments array or view-arguments object supplied to this hook.
  • $template (mixed): The template value supplied to this hook.
  • $renderer (object): The renderer value supplied to this hook.

Return

array: The filtered $args value.

add_filter( 'document_library_pro_facetwp_custom_args', function( $args, $template, $renderer ) {
    if ( 'dlp_grid_template' === $template ) {
        $args['layout'] = 'grid';
    }
    return $args;
}, 10, 3 );

document_library_pro_disable_searchwp_integration

Controls whether the bundled SearchWP integration is disabled.

Arguments

  • $disabled (bool): The disabled value supplied to this hook.

Return

bool: The filtered $disabled value.

add_filter( 'document_library_pro_disable_searchwp_integration', '__return_true' );

Actions

document_library_pro_parse_args

Fires after the library arguments have been parsed and validated.

Arguments

  • $args: The current library arguments object.
add_action( 'document_library_pro_parse_args', function( $args ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_args_updated

Fires after the arguments on an existing library view are updated.

Arguments

  • $view: The current document view object.
add_action( 'document_library_pro_args_updated', function( $view ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_before_get_table

Fires immediately before table output is generated.

Arguments

  • $view: The current document view object.
add_action( 'document_library_pro_before_get_table', function( $view ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_after_get_table

Fires immediately after table output has been generated.

Arguments

  • $view: The current document view object.
add_action( 'document_library_pro_after_get_table', function( $view ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_before_get_data

Fires before document rows are fetched for a table.

Arguments

  • $view: The current document view object.
add_action( 'document_library_pro_before_get_data', function( $view ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_after_get_data

Fires after document rows have been fetched for a table.

Arguments

  • $view: The current document view object.
add_action( 'document_library_pro_after_get_data', function( $view ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_before_posts_query

Fires before the document query runs. The plugin prefix is supplied on the DataViews path but not on the legacy path.

Arguments

  • $query: The current query object.
  • $plugin_prefix: The DataViews plugin prefix, when available.
add_action( 'document_library_pro_before_posts_query', function( $query, $plugin_prefix = '' ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_after_posts_query

Fires after the legacy WordPress posts query has run. This action is legacy-only.

Arguments

  • $query: The legacy table query object.
add_action( 'document_library_pro_after_posts_query', function( $query ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_after_query

Fires after a DataViews query has run. This action is DataViews-only.

Arguments

  • $query: The DataViews query object.
  • $plugin_prefix: The DataViews plugin prefix.
add_action( 'document_library_pro_after_query', function( $query, $plugin_prefix ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_before_get_grid

Fires before grid output is generated.

Arguments

  • $grid: The current grid or document view object.
add_action( 'document_library_pro_before_get_grid', function( $grid ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_after_get_grid

Fires after grid output is generated on the current document view path.

Arguments

  • $view: The current document view object.
add_action( 'document_library_pro_after_get_grid', function( $view ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_grid_args_updated

Fires after the arguments on a legacy document grid are updated.

Arguments

  • $grid: The current document grid object.
add_action( 'document_library_pro_grid_args_updated', function( $grid ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_before_get_grid_documents

Fires before documents are fetched for a legacy grid.

Arguments

  • $grid: The current document grid object.
add_action( 'document_library_pro_before_get_grid_documents', function( $grid ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_after_get_grid_documents

Fires after documents have been fetched for a legacy grid.

Arguments

  • $grid: The current document grid object.
add_action( 'document_library_pro_after_get_grid_documents', function( $grid ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_grid_card_before_info

Fires inside a grid card before its information wrapper.

Arguments

  • $document: The current document model.
  • $args: The current library arguments.
  • $post: The current WP_Post object.
add_action( 'document_library_pro_grid_card_before_info', function( $document, $args, $post ) {
    // Add custom code here.
}, 10, 3 );

document_library_pro_grid_card_before_title

Fires inside a grid card immediately before the title.

Arguments

  • $document: The current document model.
  • $args: The current library arguments.
  • $post: The current WP_Post object.
add_action( 'document_library_pro_grid_card_before_title', function( $document, $args, $post ) {
    // Add custom code here.
}, 10, 3 );

document_library_pro_grid_card_before_excerpt

Fires inside a grid card immediately before the excerpt.

Arguments

  • $document: The current document model.
  • $args: The current library arguments.
  • $post: The current WP_Post object.
add_action( 'document_library_pro_grid_card_before_excerpt', function( $document, $args, $post ) {
    // Add custom code here.
}, 10, 3 );

Fires inside a grid card immediately before its document link.

Arguments

  • $document: The current document model.
  • $args: The current library arguments.
  • $post: The current WP_Post object.
add_action( 'document_library_pro_grid_card_before_link', function( $document, $args, $post ) {
    // Add custom code here.
}, 10, 3 );

Fires inside a grid card immediately after its document link.

Arguments

  • $document: The current document model.
  • $args: The current library arguments.
  • $post: The current WP_Post object.
add_action( 'document_library_pro_grid_card_after_link', function( $document, $args, $post ) {
    // Add custom code here.
}, 10, 3 );

document_library_pro_single_document_details_list_before

Fires before the details list on a single document page. The current post is available through the global $post variable.

Arguments

  • None.
add_action( 'document_library_pro_single_document_details_list_before', function() {
    // Add custom code here.
} );

document_library_pro_single_document_details_list_after

Fires after the details list on a single document page. The current post is available through the global $post variable.

Arguments

  • None.
add_action( 'document_library_pro_single_document_details_list_after', function() {
    // Add custom code here.
} );

Fires in the document link metabox where version-history fields can be rendered.

Arguments

  • $document: The current document model.
add_action( 'document_library_pro_document_link_version_history', function( $document ) {
    // Add custom code here.
}, 10, 1 );

Fires after the document link metabox HTML.

Arguments

  • $document: The current document model.
add_action( 'document_library_pro_document_link_metabox_after_html', function( $document ) {
    // Add custom code here.
}, 10, 1 );

Fires after document link data has been saved.

Arguments

  • $document: The current document model.
  • $type: The saved link type.
  • $data: The submitted link data.
add_action( 'document_library_pro_document_link_save', function( $document, $type, $data ) {
    // Add custom code here.
}, 10, 3 );

document_library_pro_expire_document

This scheduled action fires when a document reaches its configured expiry time. Document Library Pro runs its expiry callback at priority 10.

Arguments

  • $document_id: The expired document ID.
add_action( 'document_library_pro_expire_document', function( $document_id ) {
    // Add custom code here.
}, 20, 1 );

register_dlp_document_post_type_args

Fires while the document post type arguments are prepared. Document Library Pro Advanced uses it internally to adjust capabilities.

Arguments

  • $args: The document post type arguments.
  • $post_type: The document post type object.
add_action( 'register_dlp_document_post_type_args', function( $args, $post_type ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_import_before_import

Fires before parsed CSV data is imported.

Arguments

  • $parsed_data: All parsed CSV rows.
add_action( 'document_library_pro_import_before_import', function( $parsed_data ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_importer_before_set_parsed_data

Fires before an individual CSV row is mapped into parsed data.

Arguments

  • $row: The raw CSV row.
  • $mapped_keys: The mapped column keys.
add_action( 'document_library_pro_importer_before_set_parsed_data', function( $row, $mapped_keys ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_csv_importer_before_process_item

Fires before an individual mapped CSV row is converted into a document.

Arguments

  • $data: The mapped row data.
add_action( 'document_library_pro_csv_importer_before_process_item', function( $data ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_csv_importer_after_process_item

Fires after an individual CSV row has been converted into a document.

Arguments

  • $document_id: The new document ID.
  • $data: The mapped row data.
add_action( 'document_library_pro_csv_importer_after_process_item', function( $document_id, $data ) {
    // Add custom code here.
}, 10, 2 );

dlp_before_submission_form

Fires before the complete frontend document submission form.

Arguments

  • None.
add_action( 'dlp_before_submission_form', function() {
    // Add custom code here.
} );

dlp_after_submission_form

Fires after the complete frontend document submission form.

Arguments

  • None.
add_action( 'dlp_after_submission_form', function() {
    // Add custom code here.
} );

dlp_lead_capture_before_submission

Fires before submitted lead data is processed. Submitted values are available in $_POST.

Arguments

  • None.
add_action( 'dlp_lead_capture_before_submission', function() {
    // Add custom code here.
} );

dlp_lead_capture_submitted

Fires after a lead capture submission succeeds.

Arguments

  • $lead_data: The submitted lead data, including documents and contact fields.
add_action( 'dlp_lead_capture_submitted', function( $lead_data ) {
    // Add custom code here.
}, 10, 1 );

dlp_lead_capture_form_start

Fires before the lead capture form fields.

Arguments

  • None.
add_action( 'dlp_lead_capture_form_start', function() {
    // Add custom code here.
} );

dlp_lead_capture_form

Fires after the lead capture form fields and before the submit button.

Arguments

  • None.
add_action( 'dlp_lead_capture_form', function() {
    // Add custom code here.
} );

dlp_lead_capture_form_end

Fires after the lead capture form submit button.

Arguments

  • None.
add_action( 'dlp_lead_capture_form_end', function() {
    // Add custom code here.
} );

document_library_pro_before_login_form

Fires before the complete protected-content login form.

Arguments

  • None.
add_action( 'document_library_pro_before_login_form', function() {
    // Add custom code here.
} );

document_library_pro_after_login_form

Fires after the complete protected-content login form.

Arguments

  • None.
add_action( 'document_library_pro_after_login_form', function() {
    // Add custom code here.
} );

dlp_password_login_form_start

Fires before the password login form fields.

Arguments

  • None.
add_action( 'dlp_password_login_form_start', function() {
    // Add custom code here.
} );

dlp_password_login_form

Fires after the password login form fields and before its submit button.

Arguments

  • None.
add_action( 'dlp_password_login_form', function() {
    // Add custom code here.
} );

dlp_password_login_form_end

Fires after the password login form submit button.

Arguments

  • None.
add_action( 'dlp_password_login_form_end', function() {
    // Add custom code here.
} );

dlp_user_login_form_start

Fires before the user login form fields.

Arguments

  • None.
add_action( 'dlp_user_login_form_start', function() {
    // Add custom code here.
} );

dlp_user_login_form

Fires after the user login form fields and before its submit button.

Arguments

  • None.
add_action( 'dlp_user_login_form', function() {
    // Add custom code here.
} );

dlp_user_login_form_end

Fires after the user login form submit button.

Arguments

  • None.
add_action( 'dlp_user_login_form_end', function() {
    // Add custom code here.
} );

dlp_prevent_caching_login_page

Fires while cache-prevention headers are applied to a protected login page.

Arguments

  • None.
add_action( 'dlp_prevent_caching_login_page', function() {
    // Add custom code here.
} );

document_library_pro_protected_page

Fires when the protected-page template handler starts processing protected output.

Arguments

  • None.
add_action( 'document_library_pro_protected_page', function() {
    // Add custom code here.
} );

document_library_pro_handle_protection

Fires while the template handler selects protected output.

Arguments

  • None.
add_action( 'document_library_pro_handle_protection', function() {
    // Add custom code here.
} );

document_library_pro_handle_404

Fires while the protected-content 404 response is handled.

Arguments

  • None.
add_action( 'document_library_pro_handle_404', function() {
    // Add custom code here.
} );

document_library_pro_protected_page_prevent_caching

Fires when caching is prevented for a protected page.

Arguments

  • None.
add_action( 'document_library_pro_protected_page_prevent_caching', function() {
    // Add custom code here.
} );

document_library_pro_prevent_indexing

Fires when search-engine indexing prevention is output for protected content.

Arguments

  • None.
add_action( 'document_library_pro_prevent_indexing', function() {
    // Add custom code here.
} );

document_library_pro_before_index_post

Fires before a document's searchable content is indexed.

Arguments

  • $post_id: The document post ID.
  • $post: The document WP_Post object.
add_action( 'document_library_pro_before_index_post', function( $post_id, $post ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_after_index_post

Fires after a document's searchable content has been indexed.

Arguments

  • $post_id: The document post ID.
  • $post: The document WP_Post object.
  • $attributes: The indexed attribute values.
add_action( 'document_library_pro_after_index_post', function( $post_id, $post, $attributes ) {
    // Add custom code here.
}, 10, 3 );

document_library_pro_before_filter_index_post

Fires before a document's filter values are indexed.

Arguments

  • $post_id: The document post ID.
  • $post: The document WP_Post object.
add_action( 'document_library_pro_before_filter_index_post', function( $post_id, $post ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_after_filter_index_post

Fires after a document's filter values have been indexed.

Arguments

  • $post_id: The document post ID.
  • $post: The document WP_Post object.
add_action( 'document_library_pro_after_filter_index_post', function( $post_id, $post ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_before_sort_index_post

Fires before a document's sort values are indexed.

Arguments

  • $post_id: The document post ID.
  • $post: The document WP_Post object.
add_action( 'document_library_pro_before_sort_index_post', function( $post_id, $post ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_after_sort_index_post

Fires after a document's sort values have been indexed.

Arguments

  • $post_id: The document post ID.
  • $post: The document WP_Post object.
add_action( 'document_library_pro_after_sort_index_post', function( $post_id, $post ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_batch_before_process

Fires before a post is processed by an index batch runner.

Arguments

  • $post_id: The document post ID.
add_action( 'document_library_pro_batch_before_process', function( $post_id ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_batch_after_process

Fires after a post is processed by an index batch runner.

Arguments

  • $post_id: The document post ID.
add_action( 'document_library_pro_batch_after_process', function( $post_id ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_full_index_queued

Fires after a full indexing run has been queued.

Arguments

  • $args: The indexing scope arguments.
add_action( 'document_library_pro_full_index_queued', function( $args ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_before_indexing_batch

Fires before a scheduled indexing batch starts.

Arguments

  • $offset: The batch offset.
  • $limit: The batch size limit.
add_action( 'document_library_pro_before_indexing_batch', function( $offset, $limit ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_after_indexing_batch

Fires after a scheduled indexing batch finishes.

Arguments

  • $processed_count: The number of processed documents.
  • $offset: The batch offset.
add_action( 'document_library_pro_after_indexing_batch', function( $processed_count, $offset ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_indexing_complete

Fires after all scheduled indexing work is complete.

Arguments

  • $plugin_prefix: The DataViews plugin prefix.
add_action( 'document_library_pro_indexing_complete', function( $plugin_prefix ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_before_index_cleanup

Fires before stale index rows are removed.

Arguments

  • $plugin_prefix: The DataViews plugin prefix.
add_action( 'document_library_pro_before_index_cleanup', function( $plugin_prefix ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_after_index_cleanup

Fires after stale index rows have been removed.

Arguments

  • $stats: Cleanup statistics.
  • $plugin_prefix: The DataViews plugin prefix.
add_action( 'document_library_pro_after_index_cleanup', function( $stats, $plugin_prefix ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_index_change_listener_registered

Fires after the DataViews index change listener has been registered.

Arguments

  • $listener: The index change listener object.
  • $plugin_prefix: The DataViews plugin prefix.
add_action( 'document_library_pro_index_change_listener_registered', function( $listener, $plugin_prefix ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_data_source_registered

Fires after the Document Library Pro DataViews data source is registered.

Arguments

  • $data_source: The registered data source object.
  • $namespace: The REST API namespace.
add_action( 'document_library_pro_data_source_registered', function( $data_source, $namespace ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_orm_mappings_registered

Fires after DataViews ORM mappings are registered.

Arguments

  • $orm: The ORM instance.
  • $plugin_prefix: The DataViews plugin prefix.
  • $service: The ORM mapping service.
add_action( 'document_library_pro_orm_mappings_registered', function( $orm, $plugin_prefix, $service ) {
    // Add custom code here.
}, 10, 3 );

document_library_pro_hooks_before_register

Fires before a DataViews hook manager registers its WordPress hooks.

Arguments

  • $manager: The hook manager object.
add_action( 'document_library_pro_hooks_before_register', function( $manager ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_hooks_after_register

Fires after a DataViews hook manager registers its WordPress hooks.

Arguments

  • $manager: The hook manager object.
add_action( 'document_library_pro_hooks_after_register', function( $manager ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_before_deactivate

Fires before the DataViews installer performs deactivation cleanup.

Arguments

  • $plugin_prefix: The DataViews plugin prefix.
add_action( 'document_library_pro_before_deactivate', function( $plugin_prefix ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_after_deactivate

Fires after the DataViews installer performs deactivation cleanup.

Arguments

  • $plugin_prefix: The DataViews plugin prefix.
add_action( 'document_library_pro_after_deactivate', function( $plugin_prefix ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_tables_created

Fires after DataViews index tables have been created or updated.

Arguments

  • $plugin_prefix: The DataViews plugin prefix.
  • $tables: The managed table definitions.
add_action( 'document_library_pro_tables_created', function( $plugin_prefix, $tables ) {
    // Add custom code here.
}, 10, 2 );

document_library_pro_tables_dropped

Fires after DataViews index tables have been dropped.

Arguments

  • $plugin_prefix: The DataViews plugin prefix.
add_action( 'document_library_pro_tables_dropped', function( $plugin_prefix ) {
    // Add custom code here.
}, 10, 1 );

document_library_pro_tables_truncated

Fires after DataViews index tables have been truncated.

Arguments

  • $plugin_prefix: The DataViews plugin prefix.
add_action( 'document_library_pro_tables_truncated', function( $plugin_prefix ) {
    // Add custom code here.
}, 10, 1 );

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.