{"id":4967,"date":"2026-01-26T01:51:09","date_gmt":"2026-01-26T06:51:09","guid":{"rendered":"https:\/\/chubes.net\/?documentation=fetch-handler-settings"},"modified":"2026-02-13T20:21:06","modified_gmt":"2026-02-14T01:21:06","slug":"fetch-handler-settings","status":"publish","type":"documentation","link":"https:\/\/chubes.net\/docs\/data-machine\/core-system\/fetch-handler-settings\/","title":{"rendered":"Fetch Handler Settings"},"content":{"rendered":"<p><strong>File Location<\/strong>: <code>inc\/Core\/Steps\/Fetch\/Handlers\/FetchHandlerSettings.php<\/code><\/p><p><strong>Since<\/strong>: 0.2.1<\/p><p>Base settings class for all fetch handlers providing common fields and standardized configuration patterns.<\/p><h2 class=\"wp-block-heading\">Overview<\/h2><p>FetchHandlerSettings extends the base SettingsHandler class and provides common settings fields shared across all fetch handlers. Individual fetch handlers extend this class to add handler-specific customizations.<\/p><h2 class=\"wp-block-heading\">Architecture<\/h2><p><strong>Inheritance<\/strong>: <code>FetchHandlerSettings extends SettingsHandler<\/code>\n<strong>Location<\/strong>: <code>\/inc\/Core\/Steps\/Fetch\/Handlers\/FetchHandlerSettings.php<\/code>\n<strong>Purpose<\/strong>: Common fetch handler configuration fields<\/p><h2 class=\"wp-block-heading\">Common Fields<\/h2><h3 class=\"wp-block-heading\">timeframe_limit<\/h3><p>Timeframe filtering for content processing.<\/p><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">php<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-php\"><code class=\"language-php\">&#039;timeframe_limit&#039; =&gt; [\n    &#039;type&#039; =&gt; &#039;select&#039;,\n    &#039;label&#039; =&gt; __(&#039;Process Items Within&#039;, &#039;datamachine&#039;),\n    &#039;description&#039; =&gt; __(&#039;Only consider items published within this timeframe.&#039;, &#039;datamachine&#039;),\n    &#039;options&#039; =&gt; apply_filters(&#039;datamachine_timeframe_limit&#039;, [], null),\n]<\/code><\/pre><\/div><p><strong>Options<\/strong>: Dynamically provided via <code>datamachine_timeframe_limit<\/code> filter\n<strong>Common Values<\/strong>:<\/p><ul class=\"wp-block-list\"><li><code>all_time<\/code> &#8211; No time restriction<\/li><li><code>24_hours<\/code> &#8211; Last 24 hours<\/li><li><code>72_hours<\/code> &#8211; Last 3 days<\/li><li><code>7_days<\/code> &#8211; Last week<\/li><li><code>30_days<\/code> &#8211; Last month<\/li><\/ul><h3 class=\"wp-block-heading\">search<\/h3><p>Keyword-based content filtering.<\/p><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">php<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-php\"><code class=\"language-php\">&#039;search&#039; =&gt; [\n    &#039;type&#039; =&gt; &#039;text&#039;,\n    &#039;label&#039; =&gt; __(&#039;Search Term Filter&#039;, &#039;datamachine&#039;),\n    &#039;description&#039; =&gt; __(&#039;Filter items by keywords (comma-separated). Items containing any keyword in their title or content will be included.&#039;, &#039;datamachine&#039;),\n]<\/code><\/pre><\/div><p><strong>Features<\/strong>:<\/p><ul class=\"wp-block-list\"><li>Comma-separated keyword support<\/li><li>Case-insensitive matching<\/li><li>OR logic (any keyword match includes item)<\/li><li>Applied to title and content fields<\/li><\/ul><h2 class=\"wp-block-heading\">Usage Pattern<\/h2><p>Fetch handlers extend FetchHandlerSettings and add their specific fields:<\/p><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">php<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-php\"><code class=\"language-php\">use DataMachineCoreStepsFetchHandlersFetchHandlerSettings;\n\nclass MyFetchHandlerSettings extends FetchHandlerSettings {\n    public static function get_fields(): array {\n        return array_merge(\n            self::get_common_fields(), \/\/ timeframe_limit, search\n            [\n                &#039;custom_field&#039; =&gt; [\n                    &#039;type&#039; =&gt; &#039;text&#039;,\n                    &#039;label&#039; =&gt; __(&#039;Custom Setting&#039;, &#039;datamachine&#039;),\n                    &#039;default&#039; =&gt; &#039;&#039;\n                ]\n            ]\n        );\n    }\n}<\/code><\/pre><\/div><h2 class=\"wp-block-heading\">Integration with Centralized Filters<\/h2><p>The common fields integrate with centralized handler filter system:<\/p><h3 class=\"wp-block-heading\">Timeframe Processing<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">php<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-php\"><code class=\"language-php\">\/\/ Centralized timeframe conversion\n$cutoff_timestamp = apply_filters(&#039;datamachine_timeframe_limit&#039;, null, &#039;24_hours&#039;);\n\n\/\/ Used in database queries\n$date_query = $cutoff_timestamp ? [&#039;after&#039; =&gt; gmdate(&#039;Y-m-d H:i:s&#039;, $cutoff_timestamp)] : [];<\/code><\/pre><\/div><h3 class=\"wp-block-heading\">Keyword Matching<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">php<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-php\"><code class=\"language-php\">\/\/ Centralized keyword filtering\n$matches = apply_filters(&#039;datamachine_keyword_search_match&#039;, true, $content, $search_keywords);\nif (!$matches) continue; \/\/ Skip non-matching items<\/code><\/pre><\/div><h2 class=\"wp-block-heading\">Benefits<\/h2><ul class=\"wp-block-list\"><li><strong>Code Deduplication<\/strong>: Common fields defined once, used by all fetch handlers<\/li><li><strong>Consistency<\/strong>: Uniform timeframe and search behavior across handlers<\/li><li><strong>Maintainability<\/strong>: Centralized field definitions<\/li><li><strong>Extensibility<\/strong>: Easy to add new common fields for all fetch handlers<\/li><\/ul><h2 class=\"wp-block-heading\">Handlers Using This Base Class<\/h2><p>All fetch handlers extend FetchHandlerSettings:<\/p><ul class=\"wp-block-list\"><li>WordPress Local<\/li><li>WordPress Media<\/li><li>WordPress API<\/li><li>RSS<\/li><li>Reddit<\/li><li>Google Sheets Fetch<\/li><li>Files<\/li><\/ul><h2 class=\"wp-block-heading\">See Also<\/h2><ul class=\"wp-block-list\"><li>SettingsHandler &#8211; Base settings class<\/li><li>PublishHandlerSettings &#8211; Publish handler base settings<\/li><li>SettingsDisplayService &#8211; UI display logic<\/li><li><a href=\"https:\/\/chubes.net\/docs\/data-machine\/data-machine-architecture\/#centralized-handler-filters\">Centralized Handler Filters<\/a> &#8211; Filter integration<\/li><\/ul>","protected":false},"excerpt":{"rendered":"<p>File Location: inc\/Core\/Steps\/Fetch\/Handlers\/FetchHandlerSettings.php Since: 0.2.1 Base settings class for all fetch handlers providing common fields and standardized configuration patterns. Overview FetchHandlerSettings extends the base SettingsHandler class and provides common settings&#8230;<\/p>\n","protected":false},"featured_media":0,"template":"","meta":{"footnotes":""},"tags":[],"project":[506],"project_type":[484],"class_list":["post-4967","documentation","type-documentation","status-publish","hentry","project-core-system","project_type-wordpress-plugins"],"project_info":{"id":487,"name":"Data Machine","slug":"data-machine"},"project_type_info":{"id":484,"name":"WordPress Plugins","slug":"wordpress-plugins"},"_links":{"self":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/4967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/types\/documentation"}],"version-history":[{"count":3,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/4967\/revisions"}],"predecessor-version":[{"id":9296,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/4967\/revisions\/9296"}],"wp:attachment":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/media?parent=4967"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/tags?post=4967"},{"taxonomy":"project","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project?post=4967"},{"taxonomy":"project_type","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project_type?post=4967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}