feat: Try to modify the TablePress menu
This commit is contained in:
parent
c18048cb1a
commit
81a1e48b91
@ -38,4 +38,7 @@ Note that the {}-expressions allowed in the entries of the table definition incl
|
||||
|
||||
##### Building
|
||||
|
||||
To produce an installable zip file, change directories into a git clone of this repository, and simply execute the command in mkplugin.sh (for example, via `bash mkplugin.sh`). Note that currently you must update the version number in the mkplugin.sh command.
|
||||
To produce an installable zip file, assuming you have cloned this repository:
|
||||
1. Make sure that you have committed your changes with an update to the Version parameter in tablepress-pods.php.
|
||||
1. Make sure the current git head is on the commit you want to build.
|
||||
1. From the top-level directory of the repository, execute `bash mkplugin.sh`.
|
||||
|
@ -1 +1,5 @@
|
||||
git archive HEAD --prefix=tablepress-pods/ --format=zip -o tablepress-pods-0.2.zip
|
||||
verline=$(grep Version tablepress-pods.php)
|
||||
cvline=${verline//[$'\t\r\n']}
|
||||
destfile="tablepress-pods-${cvline#V*: }.zip"
|
||||
echo "Writing $destfile..."
|
||||
git archive HEAD --prefix=tablepress-pods/ --format=zip -o $destfile
|
||||
|
@ -3,7 +3,7 @@
|
||||
Plugin Name: TablePress Extension: Pods tables
|
||||
Plugin URI: https://code.studioinfinity.org/glen/tablepress-pods
|
||||
Description: Custom Extension for TablePress to incorporate Pods information in tables
|
||||
Version: 0.2
|
||||
Version: 0.2.3
|
||||
Author: Glen Whitney
|
||||
Author URI: http ://studioinfinity.org/
|
||||
*/
|
||||
@ -58,6 +58,7 @@ Street, Fifth Floor, Boston, MA 02110-1301 , USA.
|
||||
add_filter( 'tablepress_shortcode_table_default_shortcode_atts',
|
||||
'playground_add_shortcode_parameter_pods' );
|
||||
add_filter( 'tablepress_table_raw_render_data', 'playground_expand_pod', 10, 2 );
|
||||
add_filter( 'tablepress_admin_view_actions', 'playground_add_export_pod_action')
|
||||
|
||||
function playground_add_shortcode_parameter_pods( $default_atts ) {
|
||||
$default_atts['pod_name'] = '';
|
||||
@ -66,6 +67,18 @@ function playground_add_shortcode_parameter_pods( $default_atts ) {
|
||||
return $default_atts;
|
||||
}
|
||||
|
||||
function playground_add_export_pod_action( $view_actions ) {
|
||||
$view_actions['exportpods'] = array(
|
||||
'show_entry' => true,
|
||||
'page_title' => __( 'Export Pods Table', 'tablepress' ),
|
||||
'admin_menu_title' => __( 'Export Pods Table', 'tablepress' ),
|
||||
'nav_tab_title' => _x( 'Export Pods', 'navigation bar', 'tablepress' ),
|
||||
'required_cap' => 'tablepress_export_tables',
|
||||
);
|
||||
unset($view_actions['import']);
|
||||
return $view_actions;
|
||||
}
|
||||
|
||||
function playground_expand_pod( $table, $render_options) {
|
||||
if (empty($render_options['pod_name'])) return $table;
|
||||
$pod_params = array('limit'=>-1);
|
||||
|
Loading…
Reference in New Issue
Block a user