katart17
Forum Replies Created
-
Forum: Plugins
In reply to: [Zero Spam for WordPress] Gravity Forms Spinning WheelSame problem here. You don’t need to disable the plugin. You can just uncheck the Gravity Forms support in the Zero Spam settings.
Forum: Plugins
In reply to: [Master Slider - Responsive Touch Slider] Slide Image Position@averta Do you have any plans to allow the user to change the position of the background image. Master Slider defaults to
center center
. I know other Slider Plugins allow the user to change the position toleft top
, orcenter top
, orright bottom
and so on.Forum: Fixing WordPress
In reply to: Can’t update WordPress Page if post_content is EmptyI found the reason for this problem!
LiquidWeb support found that the culprit was the
suhosin
PHP extension. They disabled the extension and replaced it withcagefs
.Forum: Fixing WordPress
In reply to: Can’t update WordPress Page if post_content is EmptyI’m now thinking this is server problem. All WP sites on the server have this problem. I contacted the server admin but they can’t find why this error is occurring.
We are using PHP 5.6 and MariaDB 10. Could this be a problem with MariaDB?
Forum: Fixing WordPress
In reply to: Can’t update WordPress Page if post_content is Empty@dineshinau Unfortunately, I’m not using Visual Composer.
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Format first column as a headerGreat. Thanks for your help with this.
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Format first column as a header@tobiasbg I decided to add an
else
statement to the original filter without modifying thetablepress_table_output
filter.This solution seems to work:
add_filter( 'tablepress_table_render_options', 'check_table_render_options', 10, 2 ); function check_table_render_options( $render_options, $table ) { if( $render_options['first_column_th'] === true ) { add_filter( 'tablepress_cell_tag_attributes', 'custom_cell_tag_attributes', 10, 7 ); function custom_cell_tag_attributes( $tag_attributes, $table_id, $cell_content, $row_idx, $col_idx, $colspan_row, $rowspan_col ) { if( $col_idx === 1 ) { $tag_attributes['scope'] = 'row'; } return $tag_attributes; } } else { remove_filter( 'tablepress_cell_tag_attributes', 'custom_cell_tag_attributes' ); } return $render_options; }
Do you see any errors here?
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Format first column as a headerThe following code adds the
scope="row"
attribute to the row header tag, but, as you mentioned, this will apply this to all tables on the page:add_filter( 'tablepress_table_render_options', 'check_table_render_options', 10, 2 ); function check_table_render_options( $render_options, $table ) { if( $render_options['first_column_th'] === true ) { add_filter( 'tablepress_cell_tag_attributes', 'custom_cell_tag_attributes', 10, 7 ); function custom_cell_tag_attributes( $tag_attributes, $table_id, $cell_content, $row_idx, $col_idx, $colspan_row, $rowspan_col ) { if( $col_idx === 1 ) { $tag_attributes['scope'] = 'row'; } return $tag_attributes; } } return $render_options; }
I’m still trying to wrap my head around what to do with the
tablepress_table_output
filter.Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Format first column as a headerNow we’re getting a little over my head. Can I combine hooks into one function to use pass in other variables into a single function? Here’s what I mean:
add_filter( 'tablepress_table_render_options', 'custom_cell_tag_attributes', 10, 2 ); add_filter( 'tablepress_cell_tag_attributes', 'custom_cell_tag_attributes', 10, 7 ); function custom_cell_tag_attributes() { ... }
If this is possible, could I just check if
$render_option['first_column_th'] === 'true'
?Does this make sense?
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Format first column as a headerThanks @tobiasbg
I’ve been working on a hook to add the
scope
attribute, but I was wondering how I can check for the shortcode attribute (or render_option)first_column_th
. Here is what I have so far:add_filter( 'tablepress_cell_tag_attributes', 'custom_cell_tag_attributes', 10, 7 ); function custom_cell_tag_attributes( $tag_attributes, $table_id, $cell_content, $row_idx, $col_idx, $colspan_row, $rowspan_col ) { if( $col_idx === 1 ) { $tag_attributes['scope'] = 'row'; } return $tag_attributes; }
This puts a
scope="row"
attribute to the first tag in each row, but I would only like to do this if the first tag is a header tag<th>
.Any ideas?
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Format first column as a header@tobiasbg Do you think it would be a good idea to add the
scope
attribute to theth
tag when using thefirst_column_th
parameter? The output should look something like this:<th class="column-1" scope="row">Row Header</th>
Does this make sense?
awesome! I looked through the code but didn’t see that. Thanks for letting me know.
@tobiasbg Can you create a Filter Hook that will suppress loading the default CSS file?
Something like this:
add_filter('load_default_css_from_file', '__return_false');
This would be handy for those creating a Custom Child Theme who want to use their own Table styles. As a Front-End developer, I find it harder to “override” default CSS than just use the theme’s CSS.
Forum: Plugins
In reply to: [Custom Post Type UI] PHP Warning – Invalid argument in foreachNo errors since. Thanks for the help.
Forum: Plugins
In reply to: [Custom Post Type UI] PHP Warning – Invalid argument in foreachThanks Michael, I looked at the Import/Export JSON text and noticed that the labels value was null. I manually added some labels, saved the post type and the labels array has now been recorded. Here is the Exported code:
{ "branch": { "capability_type": "post", "custom_supports": "", "description": null, "exclude_from_search": "false", "has_archive": "false", "has_archive_string": "", "hierarchical": "false", "label": "Branches", "labels": { "add_new": "Add New", "add_new_item": "Add New Branch", "all_items": "All Branches", "edit_item": "Edit Branch", "menu_name": "Branches", "new_item": "New Branch", "not_found": "No Branch Found", "not_found_in_trash": "No Branches found in Trash", "parent": "Parent Branch:", "parent_item_colon": "Parent Branch:", "search_items": "Search Branch", "view_item": "View Branch" }, "menu_icon": "dashicons-building", "menu_position": "", "name": "branch", "public": "true", "publicly_queryable": "true", "query_var": "true", "query_var_slug": "", "rest_base": "", "rewrite": "true", "rewrite_slug": "", "rewrite_withfront": "true", "show_in_menu": "true", "show_in_menu_string": "", "show_in_nav_menus": "false", "show_in_rest": "false", "show_ui": "true", "singular_label": "Branch", "supports": [ "title", "custom-fields", "page-attributes" ], "taxonomies": [] } }
I hope this would fix the error