51Degrees Pipeline plugin can be used in your theme or plugin development.
To setup, take the text from the Usage in Content column and
insert it into code snippets into your pages that will be
replaced with the corresponding values. Below is the list of properties
available with your Resource Key.
__('Name'),
'col_property_type' => __('Type'),
'col_property_category' => __('Category'),
'col_property_engine' => __('Engine'),
'col_property_content_usage' => __('Usage in Content'),
'col_property_php_usage' => __('Usage in PHP')
);
}
public function get_sortable_columns() {
return $sortable = array(
'col_property_name' => array('col_property_name', true),
'col_property_engine' => array('col_property_engine', true)
);
}
public function prepare_items() {
// Read from the cloud's authoritative entitlement map cached at
// resource-key save time, not from runtime Pipeline::$data. The
// runtime map can be empty (pipeline disabled, error, or
// exception) and excludes optional engines (e.g. fodid) when their
// feature toggle is off, even though the key entitles them.
$cachedPipeline = get_option(Options::PIPELINE);
if (!$cachedPipeline || empty($cachedPipeline['engine_properties'])) {
return;
}
$this->_column_headers = array(
$this->get_columns(),
array(),
$this->get_sortable_columns());
$results = array();
foreach ($cachedPipeline['engine_properties'] as $dataKey => $properties) {
foreach ($properties as $property) {
$results[] = array(
"col_property_name" => strtolower($property["name"]),
"col_property_category" => $property["type"],
"col_property_type" => $property["category"],
"col_property_engine" => $dataKey,
"col_property_content_usage" => '{Pipeline::get("' .
$dataKey . '"' . ', "' .
strtolower($property["name"]) . '")}',
"col_property_php_usage" => 'Pipeline::get("' . $dataKey .
'"' . ', "' . strtolower($property["name"]) . '")'
);
}
}
usort($results, function ($a, $b) {
$orderby = (!empty($_GET['orderby'])) ?
sanitize_text_field($_GET['orderby']) : 'col_property_name';
$order = (!empty($_GET['order'])) ?
sanitize_text_field($_GET['order']) : 'asc';
$result = strcmp($a[$orderby], $b[$orderby]);
return ($order === 'asc') ? $result : -$result;
});
$this->items = $results;
}
public function display_rows() {
$records = $this->items;
foreach ($records as $i => $rec) {
echo '';
echo "| " . esc_html(strtolower($rec["col_property_name"])). " | ";
echo "" . esc_html($rec["col_property_category"]). " | ";
echo "" . esc_html($rec["col_property_type"]) . " | ";
echo "" . esc_html($rec["col_property_engine"]). " | ";
echo "" . esc_html($rec["col_property_content_usage"]). " | ";
echo "" . esc_html($rec["col_property_php_usage"]). " | ";
echo'
';
}
}
}
//Prepare Table of elements
$propertyTable = new Properties_List_table();
$propertyTable->prepare_items();
$propertyTable->display();