Jump to content
onlinetracker

Hooks in the Framework

Recommended Posts

onlinetracker    2
onlinetracker

I'm trying to address this issue that exists for awhile and I'm trying not to reinvent or modify the wheel too much. Here is the situation.

 

Here is the situation. You can do this too and I would like to submit this as an idea to add to Pagelines but I don't know if I'm the only one that would want this.

 

When you go into the control panel for Pagelines -> Site Options -> Blog and Posts, then scroll down to the "Post Excerpt or Summary Handling" section, you can disable these functions like "Posts/Blog Page excerpts.

 

When I do that on any install, it removes the hooks from processing and from remaining in the process/display of the page. Essentially, that removes any functions you throw in Functions.php that refer to excerpts such as before_excerpt and after_excerpt.

 

I think it would be great if those hooks were to remain functional even after disabling the function. That way you can continue to use the hooks without displaying an excerpt.

 

I understand there are other solutions, but perhaps its a feature that people can utilize and make development life easier by default.

 

What do you think?

 

ps... if this belongs somewhere else, let me know, or if you can, go ahead and move it.

Share this post


Link to post
Share on other sites
Rob    547
Rob

Hi,

 

I just want to clarify....

 

You are saying that if you have any hooks in the plugin pagelines-customize/functions.php, a child theme or in Hooker (plugin) and you change the settings for post excerpt handling in Dashboard > PageLines > Site Options > Blog And Posts, the hooks (no matter what they are), are made iinactive?

 

I know that changing settings in Site Options will overwrite functions added incorrectly to the functions.php in the site, as it is overwritten to deal with the settings.  But what you seem to be describing has never been reported previously.   Please confirm my understanding is correct.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
onlinetracker    2
onlinetracker

Hi,

 

I just want to clarify....

 

You are saying that if you have any hooks in the plugin pagelines-customize/functions.php, a child theme or in Hooker (plugin) and you change the settings for post excerpt handling in Dashboard > PageLines > Site Options > Blog And Posts, the hooks (no matter what they are), are made iinactive?

 

I know that changing settings in Site Options will overwrite functions added incorrectly to the functions.php in the site, as it is overwritten to deal with the settings.  But what you seem to be describing has never been reported previously.   Please confirm my understanding is correct.

 

 

I'm not sure about the "no matter what they are" aspect, but if I put a fuction in functions.php and it is supposed to run off the hook for "pagelines_loop_after_excerpt" or "pagelines_loop_before_excerpt", it all goes away the moment I turn off excerpts from the Blog&Posts section of the Pagelines console. Yep.

 

As for the "added incorrectly" part, I may not know right from wrong if this is wrong, let me know...

 

This is in my Pagelines Customize Functions.php file:

 

add_action('pagelines_loop_after_excerpt','my_related_posts');
    function my_related_posts() {

if ( function_exists('related_posts') ) { related_posts(); }
 }

Share this post


Link to post
Share on other sites
Rob    547
Rob

I'm sorry if I wasn't clear. I meant that if you use functions.php directly in the wp-content/themes/pagelines folder, that would be incorrect.  It will be that particular functions.php which is overwritten.  The ones in PageLines Customize, child themes or are not overwritten, and Hooker writes directly to the database.

 

Unfortunately, I'm not a programmer, so I don't know if your hook is correctly written, but you have it in the correct file.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×