{"id":15964705,"url":"https://github.com/ed-itsolutions/wordpress-fns","last_synced_at":"2026-03-09T00:32:42.009Z","repository":{"id":56974857,"uuid":"169565896","full_name":"Ed-ITSolutions/wordpress-fns","owner":"Ed-ITSolutions","description":"A collection of functions to help with WordPress theme \u0026 plugin development.","archived":false,"fork":false,"pushed_at":"2024-07-06T16:47:09.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T03:55:51.943Z","etag":null,"topics":["wordpress","wordpress-development"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/ed-itsolutions/wordpress-fns","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ed-ITSolutions.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-07T12:08:26.000Z","updated_at":"2024-07-06T16:46:08.000Z","dependencies_parsed_at":"2024-07-06T17:48:26.170Z","dependency_job_id":"38c337e3-14a9-4865-9c07-a6aaccb89652","html_url":"https://github.com/Ed-ITSolutions/wordpress-fns","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":"0.19999999999999996","last_synced_commit":"e523e86bedaf2c5786b2d20eefb671f47323eeb7"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ed-ITSolutions%2Fwordpress-fns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ed-ITSolutions%2Fwordpress-fns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ed-ITSolutions%2Fwordpress-fns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ed-ITSolutions%2Fwordpress-fns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ed-ITSolutions","download_url":"https://codeload.github.com/Ed-ITSolutions/wordpress-fns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241863498,"owners_count":20032998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress","wordpress-development"],"created_at":"2024-10-07T17:04:02.376Z","updated_at":"2026-03-09T00:32:41.956Z","avatar_url":"https://github.com/Ed-ITSolutions.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress Fns\n\nA collection of functions to help with WordPress theme \u0026 plugin development.\n\n# Install\n\nInstall from Composer:\n\n```bash\ncomposer require ed-itsolutions/wordpress-fns\n```\n\nThen add `require('vendor/autoload.php');` to the top of your `functions.php`.\n\n# Functions\n\n## wordpress_fns_as_filter($functionName, $priority = 10, $args = 1)\n\nAdds the named function `$functionName` as a filter with the same name.\n\n## wordpress_fns_featured_image_at_size($postId, $imageSize)\n\nReturns the given posts `$postId` featured image at size `$imageSize`.\n\nReturns `false` if the post does not have a featured image.\n\n## wordpress_fns_format_as_date($date)\n\nReturns the given date using the WordPress sites date formatting.\n\n`$date` can either be a timestamp or anything that [strtotime](https://www.php.net/manual/en/function.strtotime.php) can handle.\n\n## wordpress_fns_get_attachment_id_from_url($url)\n\nReturns the id of the attachment from the url. Extremely useful when working with meta boxes etc... that store an images URL instead of its attachment id.\n\nReturns `false` if no attachment could be found.\n\n## wordpress_fns_get_page_sub_menu_items($pageId, $menuName)\n\nReturns an array of menu items that are the direct desendants of the supplied page `$pageId` on the menu `$menuName`.\n\nReturns an empty array if it couldn't find the menu item for the supplied page.\n\n## wordpress_fns_header_or_featured_image($imageSize, $postId = 0)\n\nIf the page has a featured image that image at the given size `$imageSize` will be returned, otherwise it returns the header image set in the customizer.\n\nSupplying `$postId` will return the given posts image.\n\n# Contributing\n\nWe welcome PRs to this project. If you have a function or improvement feel free to add them.\n\nWe ask that:\n\n - All functions be prefixed with `wordpress_fns_`.\n - All functions return `false` instead of throwing an error or null.\n - Don't add actions or filters, if users want to use a function as a filter they can do it themselves.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fed-itsolutions%2Fwordpress-fns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fed-itsolutions%2Fwordpress-fns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fed-itsolutions%2Fwordpress-fns/lists"}