Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

It was working with a warning but now I have: Parse error: syntax error, unexpected 'is' (T_STRING) in /home/content/35/14040635/html/drsamtocco/wp-content/themes/buro/buro/functions/admin-hooks.php on line 92 WordPress

  • SOLVED

This code is making the site not load:
<?php

/*-------------------------------------------------------------------------------------

TABLE OF CONTENTS

- Hook Definitions

- Contextual Hook and Filter Functions
-- woo_do_atomic()
-- woo_apply_atomic()
-- woo_get_Something is wrong_context()

-------------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/* Hook Definitions */
/*-----------------------------------------------------------------------------------*/

// header.php
function woo_head() { woo_do_atomic( 'woo_head' ); }
function woo_top() { woo_do_atomic( 'woo_top' ); }
function woo_header_before() { woo_do_atomic( 'woo_header_before' ); }
function woo_header_inside() { woo_do_atomic( 'woo_header_inside' ); }
function woo_header_after() { woo_do_atomic( 'woo_header_after' ); }
function woo_nav_before() { woo_do_atomic( 'woo_nav_before' ); }
function woo_nav_inside() { woo_do_atomic( 'woo_nav_inside' ); }
function woo_nav_after() { woo_do_atomic( 'woo_nav_after' ); }

// Template files: 404, archive, single, page, sidebar, index, search
function woo_content_before() { woo_do_atomic( 'woo_content_before' ); }
function woo_content_after() { woo_do_atomic( 'woo_content_after' ); }
function woo_main_before() { woo_do_atomic( 'woo_main_before' ); }
function woo_main_after() { woo_do_atomic( 'woo_main_after' ); }
function woo_post_before() { woo_do_atomic( 'woo_post_before' ); }
function woo_post_after() { woo_do_atomic( 'woo_post_after' ); }
function woo_post_inside_before() { woo_do_atomic( 'woo_post_inside_before' ); }
function woo_post_inside_after() { woo_do_atomic( 'woo_post_inside_after' ); }
function woo_loop_before() { woo_do_atomic( 'woo_loop_before' ); }
function woo_loop_after() { woo_do_atomic( 'woo_loop_after' ); }

// Tumblog Functionality
function woo_tumblog_content_before() { woo_do_atomic( 'woo_tumblog_content_before', 'Before' ); }
function woo_tumblog_content_after() { woo_do_atomic( 'woo_tumblog_content_after', 'After' ); }

// Sidebar
function woo_sidebar_before() { woo_do_atomic( 'woo_sidebar_before' ); }
function woo_sidebar_inside_before() { woo_do_atomic( 'woo_sidebar_inside_before' ); }
function woo_sidebar_inside_after() { woo_do_atomic( 'woo_sidebar_inside_after' ); }
function woo_sidebar_after() { woo_do_atomic( 'woo_sidebar_after' ); }

// footer.php
function woo_footer_top() { woo_do_atomic( 'woo_footer_top' ); }
function woo_footer_before() { woo_do_atomic( 'woo_footer_before' ); }
function woo_footer_inside() { woo_do_atomic( 'woo_footer_inside' ); }
function woo_footer_after() { woo_do_atomic( 'woo_footer_after' ); }
function woo_foot() { woo_do_atomic( 'woo_foot' ); }

/*-----------------------------------------------------------------------------------*/
/* Contextual Hook and Filter Functions */
/*-----------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/* woo_do_atomic() */
/*-----------------------------------------------------------------------------------*/
/**
* Adds contextual action hooks to the theme. This allows users to easily add context-based content
* without having to know how to use WordPress conditional tags. The theme handles the logic.
*
* An example of a basic hook would be 'woo_head'. The woo_do_atomic() function extends that to
* give extra hooks such as 'woo_head_home', 'woo_head_singular', and 'woo_head_singular-page'.
*
* Major props to Ptah Dunbar for the do_atomic() function.
* @link http://ptahdunbar.com/wordpress/smarter-hooks-context-sensitive-hooks
*
* @since 3.9.0
* @uses woo_get_Something is wrong_context() Gets the context of the current page.
* @param string $tag Usually the location of the hook but defines what the base hook is.
*/



if ( ! function_exists( 'woo_do_atomic' ) ) {
function woo_do_atomic( $tag = '', $args = '' ) {

if ( !$tag ) { return false; } // End IF Statement

/* Do actions on the basic hook. */
do_action( $tag, $args );

/* Loop through context array and fire actions on a contextual scale. */
foreach ( (array) woo_get_Something is wrong_context() as $context ) {

do_action( "{$tag}_{$context}", $args );

} // End FOREACH Loop

} // End woo_do_atomic()
} // End IF Statement

/*-----------------------------------------------------------------------------------*/
/* woo_apply_atomic() */
/*-----------------------------------------------------------------------------------*/
/**
* Adds contextual filter hooks to the theme. This allows users to easily filter context-based content
* without having to know how to use WordPress conditional tags. The theme handles the logic.
*
* An example of a basic hook would be 'woo_entry_meta'. The woo_apply_atomic() function extends
* that to give extra hooks such as 'woo_entry_meta_home', 'woo_entry_meta_singular' and 'woo_entry_meta_singular-page'.
*
* @since 3.9.0
* @uses woo_get_Something is wrong_context() Gets the context of the current page.
* @param string $tag Usually the location of the hook but defines what the base hook is.
* @param mixed $value The value to be filtered.
* @return mixed $value The value after it has been filtered.
*/


if ( ! function_exists( 'woo_apply_atomic' ) ) {
function woo_apply_atomic( $tag = '', $value = '' ) {

if ( !$tag )
return false;

/* Get theme prefix. */
// $pre = woo_get_prefix();
$pre = 'woo';

/* Apply filters on the basic hook. */
$value = apply_filters( "{$pre}_{$tag}", $value );

/* Loop through context array and apply filters on a contextual scale. */
foreach ( (array)woo_get_Something is wrong_context() as $context )
$value = apply_filters( "{$pre}_{$context}_{$tag}", $value );

/* Return the final value once all filters have been applied. */
return $value;

} // End woo_apply_atomic()
} // End IF Statement

/*-----------------------------------------------------------------------------------*/
/* woo_get_Something is wrong_context() */
/*-----------------------------------------------------------------------------------*/
/**
* Retrieve the context of the queried template.
*
* @since 3.9.0
* @return array $Something is wrong_context
*/

if ( ! function_exists( 'woo_get_Something is wrong_context' ) ) {
function woo_get_Something is wrong_context() {
global $wp_Something is wrong, $Something is wrong_context;

/* If $Something is wrong_context->context has been set, don't run through the conditionals again. Just return the variable. */
if ( isset( $Something is wrong_context->context ) && is_array( $Something is wrong_context->context ) ) {

return $Something is wrong_context->context;

} // End IF Statement

$Something is wrong_context->context = array();

/* Front page of the site. */
if ( is_front_page() ) {

$Something is wrong_context->context[] = 'home';

} // End IF Statement

/* Blog page. */
if ( is_home() && ! is_front_page() ) {

$Something is wrong_context->context[] = 'blog';

/* Singular views. */
} elseif ( is_singular() ) {

$Something is wrong_context->context[] = 'singular';
$Something is wrong_context->context[] = "singular-{$wp_Something is wrong->post->post_type}";

/* Page Templates. */
if ( is_page_template() ) {

$to_skip = array( 'page', 'post' );

$page_template = basename( get_page_template() );
$page_template = str_replace( '.php', '', $page_template );
$page_template = str_replace( '.', '-', $page_template );

if ( $page_template && ! in_array( $page_template, $to_skip ) ) {

$Something is wrong_context->context[] = $page_template;

} // End IF Statement

} // End IF Statement

$Something is wrong_context->context[] = "singular-{$wp_Something is wrong->post->post_type}-{$wp_Something is wrong->post->ID}";
}

/* Archive views. */
elseif ( is_archive() ) {
$Something is wrong_context->context[] = 'archive';

/* Taxonomy archives. */
if ( is_tax() || is_category() || is_tag() ) {
$term = $wp_Something is wrong->get_queried_object();
$Something is wrong_context->context[] = 'taxonomy';
$Something is wrong_context->context[] = $term->taxonomy;
$Something is wrong_context->context[] = "{$term->taxonomy}-" . sanitize_html_class( $term->slug, $term->term_id );
}

/* User/author archives. */
elseif ( is_author() ) {
$Something is wrong_context->context[] = 'user';
$Something is wrong_context->context[] = 'user-' . sanitize_html_class( get_the_author_meta( 'user_nicename', get_Something is wrong_var( 'author' ) ), $wp_Something is wrong->get_queried_object_id() );
}

/* Time/Date archives. */
else {
if ( is_date() ) {
$Something is wrong_context->context[] = 'date';
if ( is_year() )
$Something is wrong_context->context[] = 'year';
if ( is_month() )
$Something is wrong_context->context[] = 'month';
if ( get_Something is wrong_var( 'w' ) )
$Something is wrong_context->context[] = 'week';
if ( is_day() )
$Something is wrong_context->context[] = 'day';
}
if ( is_time() ) {
$Something is wrong_context->context[] = 'time';
if ( get_Something is wrong_var( 'hour' ) )
$Something is wrong_context->context[] = 'hour';
if ( get_Something is wrong_var( 'minute' ) )
$Something is wrong_context->context[] = 'minute';
if (!isset($res))
}
}
}


/* Search results. */
elseif ( is_search() ) {
$Something is wrong_context->context[] = 'search';

/* Error 404 pages. */
} elseif ( is_404() ) {
$Something is wrong_context->context[] = 'error-404';

} // End IF Statement

return $Something is wrong_context->context;

} // End woo_get_Something is wrong_context()
} // End IF Statement

Answers (8)

2019-08-19

Samiha answers:

First, the "woo_get_Something is wrong_context()" is not a valid function as it contained white spaces.

Second, I think you should change "woo_get_Something is wrong_context()" to "woo_get_query_context()"

Please refer to some thing similar below, so that you are able to correct your codes:

https://github.com/kharissulistiyo/Modern-Artificer/blob/master/functions/admin-hooks.php
https://github.com/xavivars/irresistible/blob/master/functions/admin-hooks.php

Hope this helps


Samiha comments:

For fast edit, you can find "Something is wrong" and replace them all with "query"

2019-08-19

Arnav Joy answers:

have you taken backup of the theme or functions.php file before doing this?


Arnav Joy comments:

try to use this code
<?php

/*-------------------------------------------------------------------------------------

TABLE OF CONTENTS

- Hook Definitions

- Contextual Hook and Filter Functions
-- woo_do_atomic()
-- woo_apply_atomic()
-- woo_get_context()

-------------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/* Hook Definitions */
/*-----------------------------------------------------------------------------------*/

// header.php
function woo_head() { woo_do_atomic( 'woo_head' ); }
function woo_top() { woo_do_atomic( 'woo_top' ); }
function woo_header_before() { woo_do_atomic( 'woo_header_before' ); }
function woo_header_inside() { woo_do_atomic( 'woo_header_inside' ); }
function woo_header_after() { woo_do_atomic( 'woo_header_after' ); }
function woo_nav_before() { woo_do_atomic( 'woo_nav_before' ); }
function woo_nav_inside() { woo_do_atomic( 'woo_nav_inside' ); }
function woo_nav_after() { woo_do_atomic( 'woo_nav_after' ); }

// Template files: 404, archive, single, page, sidebar, index, search
function woo_content_before() { woo_do_atomic( 'woo_content_before' ); }
function woo_content_after() { woo_do_atomic( 'woo_content_after' ); }
function woo_main_before() { woo_do_atomic( 'woo_main_before' ); }
function woo_main_after() { woo_do_atomic( 'woo_main_after' ); }
function woo_post_before() { woo_do_atomic( 'woo_post_before' ); }
function woo_post_after() { woo_do_atomic( 'woo_post_after' ); }
function woo_post_inside_before() { woo_do_atomic( 'woo_post_inside_before' ); }
function woo_post_inside_after() { woo_do_atomic( 'woo_post_inside_after' ); }
function woo_loop_before() { woo_do_atomic( 'woo_loop_before' ); }
function woo_loop_after() { woo_do_atomic( 'woo_loop_after' ); }

// Tumblog Functionality
function woo_tumblog_content_before() { woo_do_atomic( 'woo_tumblog_content_before', 'Before' ); }
function woo_tumblog_content_after() { woo_do_atomic( 'woo_tumblog_content_after', 'After' ); }

// Sidebar
function woo_sidebar_before() { woo_do_atomic( 'woo_sidebar_before' ); }
function woo_sidebar_inside_before() { woo_do_atomic( 'woo_sidebar_inside_before' ); }
function woo_sidebar_inside_after() { woo_do_atomic( 'woo_sidebar_inside_after' ); }
function woo_sidebar_after() { woo_do_atomic( 'woo_sidebar_after' ); }

// footer.php
function woo_footer_top() { woo_do_atomic( 'woo_footer_top' ); }
function woo_footer_before() { woo_do_atomic( 'woo_footer_before' ); }
function woo_footer_inside() { woo_do_atomic( 'woo_footer_inside' ); }
function woo_footer_after() { woo_do_atomic( 'woo_footer_after' ); }
function woo_foot() { woo_do_atomic( 'woo_foot' ); }

/*-----------------------------------------------------------------------------------*/
/* Contextual Hook and Filter Functions */
/*-----------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/* woo_do_atomic() */
/*-----------------------------------------------------------------------------------*/
/**
* Adds contextual action hooks to the theme. This allows users to easily add context-based content
* without having to know how to use WordPress conditional tags. The theme handles the logic.
*
* An example of a basic hook would be 'woo_head'. The woo_do_atomic() function extends that to
* give extra hooks such as 'woo_head_home', 'woo_head_singular', and 'woo_head_singular-page'.
*
* Major props to Ptah Dunbar for the do_atomic() function.
* @link http://ptahdunbar.com/wordpress/smarter-hooks-context-sensitive-hooks
*
* @since 3.9.0
* @uses woo_get_context() Gets the context of the current page.
* @param string $tag Usually the location of the hook but defines what the base hook is.
*/



if ( ! function_exists( 'woo_do_atomic' ) ) {
function woo_do_atomic( $tag = '', $args = '' ) {

if ( !$tag ) { return false; } // End IF Statement

/* Do actions on the basic hook. */
do_action( $tag, $args );

/* Loop through context array and fire actions on a contextual scale. */
foreach ( (array) woo_get_context() as $context ) {

do_action( "{$tag}_{$context}", $args );

} // End FOREACH Loop

} // End woo_do_atomic()
} // End IF Statement

/*-----------------------------------------------------------------------------------*/
/* woo_apply_atomic() */
/*-----------------------------------------------------------------------------------*/
/**
* Adds contextual filter hooks to the theme. This allows users to easily filter context-based content
* without having to know how to use WordPress conditional tags. The theme handles the logic.
*
* An example of a basic hook would be 'woo_entry_meta'. The woo_apply_atomic() function extends
* that to give extra hooks such as 'woo_entry_meta_home', 'woo_entry_meta_singular' and 'woo_entry_meta_singular-page'.
*
* @since 3.9.0
* @uses woo_get_context() Gets the context of the current page.
* @param string $tag Usually the location of the hook but defines what the base hook is.
* @param mixed $value The value to be filtered.
* @return mixed $value The value after it has been filtered.
*/


if ( ! function_exists( 'woo_apply_atomic' ) ) {
function woo_apply_atomic( $tag = '', $value = '' ) {

if ( !$tag )
return false;

/* Get theme prefix. */
// $pre = woo_get_prefix();
$pre = 'woo';

/* Apply filters on the basic hook. */
$value = apply_filters( "{$pre}_{$tag}", $value );

/* Loop through context array and apply filters on a contextual scale. */
foreach ( (array)woo_get_context() as $context )
$value = apply_filters( "{$pre}_{$context}_{$tag}", $value );

/* Return the final value once all filters have been applied. */
return $value;

} // End woo_apply_atomic()
} // End IF Statement

/*-----------------------------------------------------------------------------------*/
/* woo_get_context() */
/*-----------------------------------------------------------------------------------*/
/**
* Retrieve the context of the queried template.
*
* @since 3.9.0
* @return array $context
*/

if ( ! function_exists( 'woo_get_context' ) ) {
function woo_get_context() {
global $wpg, $context;

/* If $context->context has been set, don't run through the conditionals again. Just return the variable. */
if ( isset( $context->context ) && is_array( $context->context ) ) {

return $context->context;

} // End IF Statement

$context->context = array();

/* Front page of the site. */
if ( is_front_page() ) {

$context->context[] = 'home';

} // End IF Statement

/* Blog page. */
if ( is_home() && ! is_front_page() ) {

$context->context[] = 'blog';

/* Singular views. */
} elseif ( is_singular() ) {

$context->context[] = 'singular';
$context->context[] = "singular-{$wpg->post->post_type}";

/* Page Templates. */
if ( is_page_template() ) {

$to_skip = array( 'page', 'post' );

$page_template = basename( get_page_template() );
$page_template = str_replace( '.php', '', $page_template );
$page_template = str_replace( '.', '-', $page_template );

if ( $page_template && ! in_array( $page_template, $to_skip ) ) {

$context->context[] = $page_template;

} // End IF Statement

} // End IF Statement

$context->context[] = "singular-{$wpg->post->post_type}-{$wpg->post->ID}";
}

/* Archive views. */
elseif ( is_archive() ) {
$context->context[] = 'archive';

/* Taxonomy archives. */
if ( is_tax() || is_category() || is_tag() ) {
$term = $wpg->get_queried_object();
$context->context[] = 'taxonomy';
$context->context[] = $term->taxonomy;
$context->context[] = "{$term->taxonomy}-" . sanitize_html_class( $term->slug, $term->term_id );
}

/* User/author archives. */
elseif ( is_author() ) {
$context->context[] = 'user';
$context->context[] = 'user-' . sanitize_html_class( get_the_author_meta( 'user_nicename', get_var( 'author' ) ), $wpg->get_queried_object_id() );
}

/* Time/Date archives. */
else {
if ( is_date() ) {
$context->context[] = 'date';
if ( is_year() )
$context->context[] = 'year';
if ( is_month() )
$context->context[] = 'month';
if ( get_var( 'w' ) )
$context->context[] = 'week';
if ( is_day() )
$context->context[] = 'day';
}
if ( is_time() ) {
$context->context[] = 'time';
if ( get_var( 'hour' ) )
$context->context[] = 'hour';
if ( get_var( 'minute' ) )
$context->context[] = 'minute';
if (!isset($res))
}
}
}


/* Search results. */
elseif ( is_search() ) {
$context->context[] = 'search';

/* Error 404 pages. */
} elseif ( is_404() ) {
$context->context[] = 'error-404';

} // End IF Statement

return $context->context;

} // End woo_get_context()
} // End IF Statement


User183415 comments:

get an error on line 200 about }


Arnav Joy comments:

please let me know if you have backup of the old file?
also is it possible you can send me access to your site to work directly there?
my email is : [email protected]
and skype is : arnav.joy

if you can add me on skype or chat me on hangout I will try to solve your problem asap.

2019-08-19

Darlene Grace Arcenal answers:

Please try this one:

<?php

/*-------------------------------------------------------------------------------------

TABLE OF CONTENTS

- Hook Definitions

- Contextual Hook and Filter Functions
-- woo_do_atomic()
-- woo_apply_atomic()
-- woo_get_query_context()

-------------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/* Hook Definitions */
/*-----------------------------------------------------------------------------------*/

// header.php
function woo_head() { woo_do_atomic( 'woo_head' ); }
function woo_top() { woo_do_atomic( 'woo_top' ); }
function woo_header_before() { woo_do_atomic( 'woo_header_before' ); }
function woo_header_inside() { woo_do_atomic( 'woo_header_inside' ); }
function woo_header_after() { woo_do_atomic( 'woo_header_after' ); }
function woo_nav_before() { woo_do_atomic( 'woo_nav_before' ); }
function woo_nav_inside() { woo_do_atomic( 'woo_nav_inside' ); }
function woo_nav_after() { woo_do_atomic( 'woo_nav_after' ); }

// Template files: 404, archive, single, page, sidebar, index, search
function woo_content_before() { woo_do_atomic( 'woo_content_before' ); }
function woo_content_after() { woo_do_atomic( 'woo_content_after' ); }
function woo_main_before() { woo_do_atomic( 'woo_main_before' ); }
function woo_main_after() { woo_do_atomic( 'woo_main_after' ); }
function woo_post_before() { woo_do_atomic( 'woo_post_before' ); }
function woo_post_after() { woo_do_atomic( 'woo_post_after' ); }
function woo_post_inside_before() { woo_do_atomic( 'woo_post_inside_before' ); }
function woo_post_inside_after() { woo_do_atomic( 'woo_post_inside_after' ); }
function woo_loop_before() { woo_do_atomic( 'woo_loop_before' ); }
function woo_loop_after() { woo_do_atomic( 'woo_loop_after' ); }

// Tumblog Functionality
function woo_tumblog_content_before() { woo_do_atomic( 'woo_tumblog_content_before', 'Before' ); }
function woo_tumblog_content_after() { woo_do_atomic( 'woo_tumblog_content_after', 'After' ); }

// Sidebar
function woo_sidebar_before() { woo_do_atomic( 'woo_sidebar_before' ); }
function woo_sidebar_inside_before() { woo_do_atomic( 'woo_sidebar_inside_before' ); }
function woo_sidebar_inside_after() { woo_do_atomic( 'woo_sidebar_inside_after' ); }
function woo_sidebar_after() { woo_do_atomic( 'woo_sidebar_after' ); }

// footer.php
function woo_footer_top() { woo_do_atomic( 'woo_footer_top' ); }
function woo_footer_before() { woo_do_atomic( 'woo_footer_before' ); }
function woo_footer_inside() { woo_do_atomic( 'woo_footer_inside' ); }
function woo_footer_after() { woo_do_atomic( 'woo_footer_after' ); }
function woo_foot() { woo_do_atomic( 'woo_foot' ); }

/*-----------------------------------------------------------------------------------*/
/* Contextual Hook and Filter Functions */
/*-----------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/* woo_do_atomic() */
/*-----------------------------------------------------------------------------------*/
/**
* Adds contextual action hooks to the theme. This allows users to easily add context-based content
* without having to know how to use WordPress conditional tags. The theme handles the logic.
*
* An example of a basic hook would be 'woo_head'. The woo_do_atomic() function extends that to
* give extra hooks such as 'woo_head_home', 'woo_head_singular', and 'woo_head_singular-page'.
*
* Major props to Ptah Dunbar for the do_atomic() function.
* @link http://ptahdunbar.com/wordpress/smarter-hooks-context-sensitive-hooks
*
* @since 3.9.0
* @uses woo_get_query_context() Gets the context of the current page.
* @param string $tag Usually the location of the hook but defines what the base hook is.
*/



if ( ! function_exists( 'woo_do_atomic' ) ) {
function woo_do_atomic( $tag = '', $args = '' ) {

if ( !$tag ) { return false; } // End IF Statement

/* Do actions on the basic hook. */
do_action( $tag, $args );

/* Loop through context array and fire actions on a contextual scale. */
foreach ( (array) woo_get_query_context() as $context ) {

do_action( "{$tag}_{$context}", $args );

} // End FOREACH Loop

} // End woo_do_atomic()
} // End IF Statement

/*-----------------------------------------------------------------------------------*/
/* woo_apply_atomic() */
/*-----------------------------------------------------------------------------------*/
/**
* Adds contextual filter hooks to the theme. This allows users to easily filter context-based content
* without having to know how to use WordPress conditional tags. The theme handles the logic.
*
* An example of a basic hook would be 'woo_entry_meta'. The woo_apply_atomic() function extends
* that to give extra hooks such as 'woo_entry_meta_home', 'woo_entry_meta_singular' and 'woo_entry_meta_singular-page'.
*
* @since 3.9.0
* @uses woo_get_query_context() Gets the context of the current page.
* @param string $tag Usually the location of the hook but defines what the base hook is.
* @param mixed $value The value to be filtered.
* @return mixed $value The value after it has been filtered.
*/


if ( ! function_exists( 'woo_apply_atomic' ) ) {
function woo_apply_atomic( $tag = '', $value = '' ) {

if ( !$tag )
return false;

/* Get theme prefix. */
// $pre = woo_get_prefix();
$pre = 'woo';

/* Apply filters on the basic hook. */
$value = apply_filters( "{$pre}_{$tag}", $value );

/* Loop through context array and apply filters on a contextual scale. */
foreach ( (array)woo_get_query_context() as $context )
$value = apply_filters( "{$pre}_{$context}_{$tag}", $value );

/* Return the final value once all filters have been applied. */
return $value;

} // End woo_apply_atomic()
} // End IF Statement

/*-----------------------------------------------------------------------------------*/
/* woo_get_query_context() */
/*-----------------------------------------------------------------------------------*/
/**
* Retrieve the context of the queried template.
*
* @since 3.9.0
* @return array $query_context
*/

if ( ! function_exists( 'woo_get_query_context' ) ) {
function woo_get_query_context() {
global $wp_query, $query_context;

/* If $query_context->context has been set, don't run through the conditionals again. Just return the variable. */
if ( isset( $query_context->context ) && is_array( $query_context->context ) ) {

return $query_context->context;

} // End IF Statement

$query_context->context = array();

/* Front page of the site. */
if ( is_front_page() ) {

$query_context->context[] = 'home';

} // End IF Statement

/* Blog page. */
if ( is_home() && ! is_front_page() ) {

$query_context->context[] = 'blog';

/* Singular views. */
} elseif ( is_singular() ) {

$query_context->context[] = 'singular';
$query_context->context[] = "singular-{$wp_query->post->post_type}";

/* Page Templates. */
if ( is_page_template() ) {

$to_skip = array( 'page', 'post' );

$page_template = basename( get_page_template() );
$page_template = str_replace( '.php', '', $page_template );
$page_template = str_replace( '.', '-', $page_template );

if ( $page_template && ! in_array( $page_template, $to_skip ) ) {

$query_context->context[] = $page_template;

} // End IF Statement

} // End IF Statement

$query_context->context[] = "singular-{$wp_query->post->post_type}-{$wp_query->post->ID}";
}

/* Archive views. */
elseif ( is_archive() ) {
$query_context->context[] = 'archive';

/* Taxonomy archives. */
if ( is_tax() || is_category() || is_tag() ) {
$term = $wp_query->get_queried_object();
$query_context->context[] = 'taxonomy';
$query_context->context[] = $term->taxonomy;
$query_context->context[] = "{$term->taxonomy}-" . sanitize_html_class( $term->slug, $term->term_id );
}

/* User/author archives. */
elseif ( is_author() ) {
$query_context->context[] = 'user';
$query_context->context[] = 'user-' . sanitize_html_class( get_the_author_meta( 'user_nicename', get_query_var( 'author' ) ), $wp_query->get_queried_object_id() );
}

/* Time/Date archives. */
else {
if ( is_date() ) {
$query_context->context[] = 'date';
if ( is_year() )
$query_context->context[] = 'year';
if ( is_month() )
$query_context->context[] = 'month';
if ( get_query_var( 'w' ) )
$query_context->context[] = 'week';
if ( is_day() )
$query_context->context[] = 'day';
}
if ( is_time() ) {
$query_context->context[] = 'time';
if ( get_query_var( 'hour' ) )
$query_context->context[] = 'hour';
if ( get_query_var( 'minute' ) )
$query_context->context[] = 'minute';
if (!isset($res))
}
}
}


/* Search results. */
elseif ( is_search() ) {
$query_context->context[] = 'search';

/* Error 404 pages. */
} elseif ( is_404() ) {
$query_context->context[] = 'error-404';

} // End IF Statement

return $query_context->context;

} // End woo_get_query_context()
}

2019-08-20

Rempty answers:

Looks like you replace the word query with Something is wrong, use this one, I did a replace to revert it

<?php

/*-------------------------------------------------------------------------------------

TABLE OF CONTENTS

- Hook Definitions

- Contextual Hook and Filter Functions
-- woo_do_atomic()
-- woo_apply_atomic()
-- woo_get_query_context()

-------------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/* Hook Definitions */
/*-----------------------------------------------------------------------------------*/

// header.php
function woo_head() { woo_do_atomic( 'woo_head' ); }
function woo_top() { woo_do_atomic( 'woo_top' ); }
function woo_header_before() { woo_do_atomic( 'woo_header_before' ); }
function woo_header_inside() { woo_do_atomic( 'woo_header_inside' ); }
function woo_header_after() { woo_do_atomic( 'woo_header_after' ); }
function woo_nav_before() { woo_do_atomic( 'woo_nav_before' ); }
function woo_nav_inside() { woo_do_atomic( 'woo_nav_inside' ); }
function woo_nav_after() { woo_do_atomic( 'woo_nav_after' ); }

// Template files: 404, archive, single, page, sidebar, index, search
function woo_content_before() { woo_do_atomic( 'woo_content_before' ); }
function woo_content_after() { woo_do_atomic( 'woo_content_after' ); }
function woo_main_before() { woo_do_atomic( 'woo_main_before' ); }
function woo_main_after() { woo_do_atomic( 'woo_main_after' ); }
function woo_post_before() { woo_do_atomic( 'woo_post_before' ); }
function woo_post_after() { woo_do_atomic( 'woo_post_after' ); }
function woo_post_inside_before() { woo_do_atomic( 'woo_post_inside_before' ); }
function woo_post_inside_after() { woo_do_atomic( 'woo_post_inside_after' ); }
function woo_loop_before() { woo_do_atomic( 'woo_loop_before' ); }
function woo_loop_after() { woo_do_atomic( 'woo_loop_after' ); }

// Tumblog Functionality
function woo_tumblog_content_before() { woo_do_atomic( 'woo_tumblog_content_before', 'Before' ); }
function woo_tumblog_content_after() { woo_do_atomic( 'woo_tumblog_content_after', 'After' ); }

// Sidebar
function woo_sidebar_before() { woo_do_atomic( 'woo_sidebar_before' ); }
function woo_sidebar_inside_before() { woo_do_atomic( 'woo_sidebar_inside_before' ); }
function woo_sidebar_inside_after() { woo_do_atomic( 'woo_sidebar_inside_after' ); }
function woo_sidebar_after() { woo_do_atomic( 'woo_sidebar_after' ); }

// footer.php
function woo_footer_top() { woo_do_atomic( 'woo_footer_top' ); }
function woo_footer_before() { woo_do_atomic( 'woo_footer_before' ); }
function woo_footer_inside() { woo_do_atomic( 'woo_footer_inside' ); }
function woo_footer_after() { woo_do_atomic( 'woo_footer_after' ); }
function woo_foot() { woo_do_atomic( 'woo_foot' ); }

/*-----------------------------------------------------------------------------------*/
/* Contextual Hook and Filter Functions */
/*-----------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/* woo_do_atomic() */
/*-----------------------------------------------------------------------------------*/
/**
* Adds contextual action hooks to the theme. This allows users to easily add context-based content
* without having to know how to use WordPress conditional tags. The theme handles the logic.
*
* An example of a basic hook would be 'woo_head'. The woo_do_atomic() function extends that to
* give extra hooks such as 'woo_head_home', 'woo_head_singular', and 'woo_head_singular-page'.
*
* Major props to Ptah Dunbar for the do_atomic() function.
* @link http://ptahdunbar.com/wordpress/smarter-hooks-context-sensitive-hooks
*
* @since 3.9.0
* @uses woo_get_query_context() Gets the context of the current page.
* @param string $tag Usually the location of the hook but defines what the base hook is.
*/



if ( ! function_exists( 'woo_do_atomic' ) ) {
function woo_do_atomic( $tag = '', $args = '' ) {

if ( !$tag ) { return false; } // End IF Statement

/* Do actions on the basic hook. */
do_action( $tag, $args );

/* Loop through context array and fire actions on a contextual scale. */
foreach ( (array) woo_get_query_context() as $context ) {

do_action( "{$tag}_{$context}", $args );

} // End FOREACH Loop

} // End woo_do_atomic()
} // End IF Statement

/*-----------------------------------------------------------------------------------*/
/* woo_apply_atomic() */
/*-----------------------------------------------------------------------------------*/
/**
* Adds contextual filter hooks to the theme. This allows users to easily filter context-based content
* without having to know how to use WordPress conditional tags. The theme handles the logic.
*
* An example of a basic hook would be 'woo_entry_meta'. The woo_apply_atomic() function extends
* that to give extra hooks such as 'woo_entry_meta_home', 'woo_entry_meta_singular' and 'woo_entry_meta_singular-page'.
*
* @since 3.9.0
* @uses woo_get_query_context() Gets the context of the current page.
* @param string $tag Usually the location of the hook but defines what the base hook is.
* @param mixed $value The value to be filtered.
* @return mixed $value The value after it has been filtered.
*/


if ( ! function_exists( 'woo_apply_atomic' ) ) {
function woo_apply_atomic( $tag = '', $value = '' ) {

if ( !$tag )
return false;

/* Get theme prefix. */
// $pre = woo_get_prefix();
$pre = 'woo';

/* Apply filters on the basic hook. */
$value = apply_filters( "{$pre}_{$tag}", $value );

/* Loop through context array and apply filters on a contextual scale. */
foreach ( (array)woo_get_query_context() as $context )
$value = apply_filters( "{$pre}_{$context}_{$tag}", $value );

/* Return the final value once all filters have been applied. */
return $value;

} // End woo_apply_atomic()
} // End IF Statement

/*-----------------------------------------------------------------------------------*/
/* woo_get_query_context() */
/*-----------------------------------------------------------------------------------*/
/**
* Retrieve the context of the queried template.
*
* @since 3.9.0
* @return array $query_context
*/

if ( ! function_exists( 'woo_get_query_context' ) ) {
function woo_get_query_context() {
global $wp_query, $query_context;

/* If $query_context->context has been set, don't run through the conditionals again. Just return the variable. */
if ( isset( $query_context->context ) && is_array( $query_context->context ) ) {

return $query_context->context;

} // End IF Statement

$query_context->context = array();

/* Front page of the site. */
if ( is_front_page() ) {

$query_context->context[] = 'home';

} // End IF Statement

/* Blog page. */
if ( is_home() && ! is_front_page() ) {

$query_context->context[] = 'blog';

/* Singular views. */
} elseif ( is_singular() ) {

$query_context->context[] = 'singular';
$query_context->context[] = "singular-{$wp_query->post->post_type}";

/* Page Templates. */
if ( is_page_template() ) {

$to_skip = array( 'page', 'post' );

$page_template = basename( get_page_template() );
$page_template = str_replace( '.php', '', $page_template );
$page_template = str_replace( '.', '-', $page_template );

if ( $page_template && ! in_array( $page_template, $to_skip ) ) {

$query_context->context[] = $page_template;

} // End IF Statement

} // End IF Statement

$query_context->context[] = "singular-{$wp_query->post->post_type}-{$wp_query->post->ID}";
}

/* Archive views. */
elseif ( is_archive() ) {
$query_context->context[] = 'archive';

/* Taxonomy archives. */
if ( is_tax() || is_category() || is_tag() ) {
$term = $wp_query->get_queried_object();
$query_context->context[] = 'taxonomy';
$query_context->context[] = $term->taxonomy;
$query_context->context[] = "{$term->taxonomy}-" . sanitize_html_class( $term->slug, $term->term_id );
}

/* User/author archives. */
elseif ( is_author() ) {
$query_context->context[] = 'user';
$query_context->context[] = 'user-' . sanitize_html_class( get_the_author_meta( 'user_nicename', get_query_var( 'author' ) ), $wp_query->get_queried_object_id() );
}

/* Time/Date archives. */
else {
if ( is_date() ) {
$query_context->context[] = 'date';
if ( is_year() )
$query_context->context[] = 'year';
if ( is_month() )
$query_context->context[] = 'month';
if ( get_query_var( 'w' ) )
$query_context->context[] = 'week';
if ( is_day() )
$query_context->context[] = 'day';
}
if ( is_time() ) {
$query_context->context[] = 'time';
if ( get_query_var( 'hour' ) )
$query_context->context[] = 'hour';
if ( get_query_var( 'minute' ) )
$query_context->context[] = 'minute';

}
}
}


/* Search results. */
elseif ( is_search() ) {
$query_context->context[] = 'search';

/* Error 404 pages. */
} elseif ( is_404() ) {
$query_context->context[] = 'error-404';

} // End IF Statement

return $query_context->context;

} // End woo_get_query_context()
} // End IF Statement

2019-08-22

Mohamed Ahmed answers:

The clear reason that you have changed the Core code of admin-hooks.php
Could you replace your code with the code here?
https://raw.githubusercontent.com/kharissulistiyo/Modern-Artificer/master/functions/admin-hooks.php

then send to me the result even the question is closed
email me at [email protected]

Regards

2019-08-19

Peter Michael answers:

You've got 'Something is wrong' strings all over the place. Looks like a search & replace operation didn't go well. :)


User183415 comments:

it is the hook from buro admin-hook.php


User183415 comments:

i know it the hook. Hoping someone knows a fix

2019-08-19

Monit Jadhav answers:

Did this code worked before? I have never seen is used in PHP hence asking if it worked before. I doubt it.

You need to rephrase this code

woo_get_Something is wrong_context()

This is not valid code hence the T_SRING error

If you have done any changes to the file, try to replace it with the original file in the theme source code.

Apart from heavy use of 'is' I don't see issues in code, if you send the theme it would be great as we can test it out for errors.

Monit

2019-08-19

Francisco Javier Carazo Gil answers:

Have you tried to change your PHP version?