get_module( 'seo_linking' ) : null; if ( ! is_object( $module ) || ! method_exists( $module, 'report_sql' ) ) { return ''; } return (string) $module->report_sql( (array) $params ); } } return array( 'id' => 'seo_linking_suggestions', 'label' => 'Link suggestions', 'description' => '', 'source' => 'sql', 'sql' => 'aieo_semlink_suggestions_sql', 'registry_id' => 'seo_linking.suggestions', 'scope' => 'local', 'version' => '1', 'per_page' => 50, 'params' => array( 'q' => array( 'type' => 'text', 'default' => '', 'label' => 'Search' ), 'src_type' => array( 'type' => 'text', 'default' => '', 'label' => 'Source type' ), 'src_id' => array( 'type' => 'int', 'default' => 0, 'label' => 'Source' ), 'anchor' => array( 'type' => 'text', 'default' => '', 'label' => 'Anchor' ), ), 'row_key' => 'id', 'default_sort' => array( 'score', 'desc' ), 'empty_state' => 'No link suggestions match. The engine proposes nothing until the catalogue is indexed, and rejections are remembered forever — so an empty Pending queue can also mean you are done.', 'capabilities' => array( 'edit' => 'aieo_report_edit', 'execute' => 'aieo_report_edit', ), 'bulk_actions' => array( array( 'id' => 'approve', 'label' => 'Approve', 'scope' => 'filter', 'confirm' => 'Approve %1$s suggestions? This publishes the links on the storefront. Phonetic and embedding matches are skipped and need a per-row look.', ), array( 'id' => 'reject', 'label' => 'Reject', 'scope' => 'filter', 'confirm' => 'Reject %1$s suggestions? Rejections are remembered across recomputes.', ), array( 'id' => 'restore', 'label' => 'Restore', 'scope' => 'filter', 'confirm' => 'Restore %1$s suggestions to pending?', ), ), 'actions' => array( array( 'id' => 'approve', 'label' => 'Approve', 'when' => array( 'key' => 'status', 'not' => 'approved' ), ), array( 'id' => 'reject', 'label' => 'Reject', 'when' => array( 'key' => 'status', 'not' => 'rejected' ), ), array( 'id' => 'restore', 'label' => 'Restore', 'when' => array( 'key' => 'status', 'not' => 'suggested' ), ), array( 'id' => 'edit_anchor', 'label' => 'Edit anchor', 'data' => array( 'anchor' => 'shown_anchor' ), ), array( 'id' => 'retarget', 'label' => 'Change target', 'when' => array( 'key' => 'status', 'is' => 'suggested' ), 'data' => array( 'target_type' => 'target_type' ), ), ), 'columns' => array( array( 'key' => 'id', 'label' => 'ID', 'type' => 'id', 'sortable' => true, 'hidden' => true, ), array( 'key' => 'select', 'label' => '', 'type' => 'selector', 'width' => '28px', 'sortable' => false, 'select' => "''", ), array( 'key' => 'source_label', 'label' => 'Source', 'type' => 'link', 'subline' => 'source_note', 'sortable' => false, 'truncate' => 46, 'tooltip' => true, 'format' => array( 'href' => 'source_href', 'external' => true ), ), array( 'key' => 'shown_anchor', 'label' => 'Anchor', 'type' => 'text', 'width' => '170px', 'sortable' => true, 'sort_key' => 'anchor_text', 'searchable' => true, 'filter' => 'text', 'subline' => 'edited_anchor', ), array( 'key' => 'target_label', 'label' => 'Target', 'type' => 'link', 'subline' => 'target_note', 'sortable' => false, 'truncate' => 46, 'tooltip' => true, 'format' => array( 'href' => 'target_href', 'external' => true ), ), array( 'key' => 'match_type', 'label' => 'Match', 'type' => 'badge', 'width' => '120px', 'sortable' => true, 'filter' => 'select', 'format' => array( 'labels' => array( 'retarget' => 'retargeted' ), 'map' => array( 'retarget' => 'info', 'exact' => 'success', 'phonetic' => 'warning', 'embedding' => 'warning', ), ), 'header_tip' => 'Bulk approval deliberately skips phonetic and embedding matches — a recall-oriented match gets a human look first, and the server reports those as skipped.', ), array( 'key' => 'present', 'label' => 'Shown as', 'type' => 'editable', 'width' => '150px', 'sortable' => true, 'filter' => 'select', 'editable' => true, 'format' => array( 'as' => 'select', 'options' => array( '' => 'Automatic', 'link' => 'Link', 'tooltip' => 'Tooltip', 'link+preview' => 'Link + preview', ), ), ), array( 'key' => 'score', 'label' => 'Score', 'type' => 'decimal', 'width' => '90px', 'sortable' => true, 'filter' => 'number_range', 'format' => array( 'precision' => 3 ), ), array( 'key' => 'status', 'label' => 'Status', 'type' => 'badge', 'width' => '110px', 'sortable' => true, 'filter' => 'select', 'format' => array( 'labels' => array( 'suggested' => 'pending', 'approved' => 'approved', 'rejected' => 'rejected', ), 'map' => array( 'suggested' => 'info', 'approved' => 'success', 'rejected' => 'muted', ), ), ), array( 'key' => 'computed_at', 'label' => 'Computed', 'type' => 'datetime', 'width' => '150px', 'nowrap' => true, 'tone' => 'secondary', 'sortable' => true, 'format' => array( 'tz' => 'utc' ), 'hidden' => true, ), array( 'key' => 'anchor_text', 'label' => 'Proposed anchor', 'type' => 'text', 'hidden' => true ), array( 'key' => 'edited_anchor', 'label' => 'Edited anchor', 'type' => 'text', 'hidden' => true ), array( 'key' => 'source_type', 'label' => 'Source type', 'type' => 'text', 'hidden' => true ), array( 'key' => 'source_id', 'label' => 'Source id', 'type' => 'id', 'hidden' => true ), array( 'key' => 'target_type', 'label' => 'Target type', 'type' => 'text', 'hidden' => true ), array( 'key' => 'target_id', 'label' => 'Target id', 'type' => 'id', 'hidden' => true ), array( 'key' => 'entity_tax', 'label' => 'Entity taxonomy', 'type' => 'text', 'hidden' => true ), array( 'key' => 'entity_term_id', 'label' => 'Entity term', 'type' => 'id', 'hidden' => true ), array( 'key' => 'anchor_norm', 'label' => 'Anchor key', 'type' => 'code', 'hidden' => true ), array( 'key' => 'model_version', 'label' => 'Model', 'type' => 'code', 'hidden' => true ), array( 'key' => 'source_href', 'label' => 'Source URL', 'type' => 'link', 'hidden' => true ), array( 'key' => 'source_note', 'label' => 'Source note', 'type' => 'text', 'hidden' => true ), array( 'key' => 'target_href', 'label' => 'Target URL', 'type' => 'link', 'hidden' => true ), array( 'key' => 'target_note', 'label' => 'Target note', 'type' => 'text', 'hidden' => true ), ), );