victorjonsson / Arlima

Article List Manager - Wordpress plugin suitable for online newspapers that's in need of a fully customizable front page
28 stars 16 forks source link

Filter arlima_article_content changed? #90

Closed ekandreas closed 9 years ago

ekandreas commented 9 years ago

I just can't find out how the filter arlima_article_content is used and following the documentation fails.

victorjonsson commented 9 years ago

Can you please provide me with some code and explain what you're trying to achieve.

ekandreas commented 9 years ago

Very simple content add... It is working in older versions of Arlima.

function my_special_content( $data )
{
    $data['content'] .= ' - Testing content add.';
    return $data;
}
add_filter( 'arlima_article_content', 'my_special_content' );
victorjonsson commented 9 years ago

That's odd... Does the article have any content at all? It will not be rendered if it's considered to be empty (missing title, content, image and child articles)

ekandreas commented 9 years ago

Well there is content but the effect is nothing and the filter is not executed at all :-( But if I go into TemplateObjectCreator, line 195 and modifies the filter request directly it is ok. Seems like the filter doesn't execute?

victorjonsson commented 9 years ago

What changes did you do on line 195?

ekandreas commented 9 years ago

Just for test:

$obj['html_content'] = 'testing'; //$this->applyFilter('arlima_article_content', $article_counter, $article, $post, $article['content']);
ekandreas commented 9 years ago

Something with the facade?

$filtered_data = Arlima_CMSFacade::load()->applyFilters($filter, $data);

It seems like WordPress filter isn't executing at all :-(

ekandreas commented 9 years ago

Simple! It was a filter with widget suffix, arlima_template_content-widget. I'm using lists inside widgets.

victorjonsson commented 9 years ago

Maybe it would be good if the inputs in the widget form has some explanations. It's easy to forget about the filter suffix.