Hi,
I am trying to understand how to use hooks and filters in Page Builder. In this example I am putting the following code in the functions.php file of my theme.
function solus_siteorigin_panels_css_object($css, $panels_data, $post_id){ $css->add_row_css($post_id,$panels_data,'', array( 'margin-left' =>'-10px', 'margin-right' =>'-10px', )); } add_filter('siteorigin_panels_css_object','solus_siteorigin_panels_css_object', 10, 3);
this causes a php error:
PHP Warning: Invalid argument supplied for foreach() in /Solus/_web/Solus/wp-content/plugins/siteorigin-panels/siteorigin-panels.php on line 919
PHP Fatal error: Call to a member function get_css() on a non-object in /Solus/wp-content/plugins/siteorigin-panels/siteorigin-panels.php on line 753
I must be missing something – or am i?
Thanks in advance.
Looking at the source I think I see the solution to the first error – $panels_data is an array, so I need to set css for each panel.
Not sure why I am still getting the second error though.
PHP Fatal error: Call to a member function get_css() on a non-object in /Solus/wp-content/plugins/siteorigin-panels/siteorigin-panels.php on line 753
Never mind I fixed it:
Thats pretty cool thanks.