do_action( 'after_setup_theme' );
doesn’t pass any parameter. You are cutting something of the length 0 after theme setup. Why?
Plus, your registration with add_action
doesn’t tell WordPress that you want two parameters. The default is one parameter.
You don’t need this call at all. If you define the function in your functions.php
it will be available in the loop.
Learn the Plugin API, it isn’t so hard. 🙂
Always prefix you functions. Otherwise your users may get fatal errors when someone else has written a function with the same name.
If your function does what I think it does, you may have a look at my function utf8_truncate()
. No regex needed.
Related Posts:
- my blog crashes ie7?
- Are immediately-called actions not usable in themes?
- Undefined offset: 0 in > […] /wp-includes/capabilities.php on line 1067
- Loading template files from a subfolder in my theme?
- The style.css stylesheet doesn’t contain a valid theme header
- Remove action within a class in a parent theme from the child theme
- Problem : deletion failed, the theme requested does not exist
- Using a _GET gives me a debug error (over my head)
- Delete database tables on theme uninstall?
- How can I show more than 15 themes at a time in the admin menu?
- How to trigger function on theme delete?
- PHP Parse error: syntax error, unexpected end of file, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) on line 230 [closed]
- wp theme.. Could not create directory
- Console error, even if everything is working?
- Make it possible to pick a color theme for specific pages
- OptimizePress Theme Overriding add_filter page_template
- Execute filter in theme as last
- Fatal error with a theme
- Getting 503 on various files
- Redux callback action
- How to display message (with switch_theme hook) after deactivating My theme?
- What hook is the currently active theme’s functions.php file loaded on? [duplicate]
- Finding and disabling ‘rogue’ stylesheet from header: Source Sans Pro
- Remove problem PHP code entered into footer via Theme
- Twenty Seventeen search error
- Is it good practice moving the main stylesheets after the plugin styles?
- WordPress suddenly creating theme errors
- Debugging in WordPress at Theme installation [duplicate]
- Posts as filtered list – expandable
- .PO file is found but I don’t see translations: how to debug the problem?
- How can I remove all traces of a theme?
- Undefined variable error in theme option after updating theme [closed]
- Using filter in the widget causes fatal error
- Error when installing theme – “failed to open stream: No such file or directory in…”
- Functions.php error – when trying to change the theme
- My blog suddenly can’t find my stylesheet?
- How to fix Scrape key check failed on WordPress VPS?
- Why does an ad page open when I browse my websites’s wp-admin page?
- Don’t prepend WordPress base url to image paths
- Problem: Fatal error worldpress theme
- Custom CSS is overwritten by WordPress?
- The function is deprecated; use mysql_real_escape_string() instead
- Warning: call_user_func() expects parameter 1 to be a valid callback
- Firebug and Chrome rendering two body tags
- Costum Theme template directoy url problem
- How to remove the option data of a theme when that theme is removed?
- Diagnosing a connection reset problem
- Where can I find the “add_action()” inside a theme?
- “Parse error: syntax error, unexpected” and the WordPress Theme Editor no longer working!
- WordPress site is not loading properly ( showing a min-page)
- Installation échouée : Le téléchargement a échoué. No working transports found
- How to create a new theme from an existing incomplete theme folder?
- Pages still display when theme is missing
- How to change background color in the Notepad++ text editor?
- How to change or add theme to Android Studio?
- WordPress frameworks and parent themes [closed]
- remove_action or remove_filter with external classes?
- Passing a parameter to filter and action functions
- Difference Between Filter and Action Hooks?
- Opinions and recommendations on the best barebones base theme [closed]
- Remove JSON API links in header html
- Using OOP in themes
- How to know what functions are hooked to an action/filter?
- Get a list of all registered actions
- Where can I download WordPress themes from? [closed]
- How can I edit post data before it is saved?
- add_action(), add_filter() before or after function
- How can I allow the Editor Role to change Theme Settings?
- How to create an API for my plugin?
- Trouble understanding apply_filters()
- What are all the available parameters for query_posts?
- What is the very earliest action hook you can call?
- remove_action on after_setup_theme not working from child theme
- How can I see all the actions attached to an “add_action” hook?
- Customizing a WordPress theme without changing it?
- Where can I learn to create my own theme?
- How do I turn off self-closing tags for markup in WordPress (for HTML5, or HTML4, for example)?
- how to add version of style.css in wordpress
- Does WordPress work without a theme?
- What is the role and history of the $content_width global variable?
- remove custom post type permalink
- Adding admin-ajax.php to the frontend. Good or bad idea?
- How do I exclude plugins from getting automatically updated?
- get_template_part vs action hooks in themes
- How to move the sidebar in TwentyFifteen to the right?
- Where is the best place to use add_filter
- How to Link External jQuery/Javascript files with WordPress
- Installation failed: Download failed. No working transports found
- What is theme-compat?
- Remove Actions/Filters added via Anonymous Functions
- Override parent theme translation on child theme
- wp_headers vs send_headers. When to use each?
- WordPress Theme activation hook?
- after_setup_theme always runs
- Can wordpress theme folder name be changed freely and nothing technically happens
- Link to specific Customizer section
- What does exactly GPL license mean for my WordPress theme?
- Am I allowed to license my WordPress theme under the aGPL
- Is there any action filter/hook for validating a custom field before publishing the post?
- How do I change the header image height in Twenty Seventeen?